allow on stack with betterC
test
test at gmail.com
Tue Oct 23 05:36:00 UTC 2018
On Tuesday, 23 October 2018 at 05:32:14 UTC, rikki cattermole
wrote:
> On 23/10/2018 6:26 PM, test wrote:
>> On Tuesday, 23 October 2018 at 05:23:42 UTC, rikki cattermole
>> wrote:
>>> On 23/10/2018 6:20 PM, test wrote:
>>>>
>>>> scope tmp = new ubyte[4];
>>>>
>>>>
>>>> Error: TypeInfo cannot be used with -betterC
>>>>
>>>>
>>>> how to bypass this ?
>>>
>>> new only exists thanks to druntime hooks.
>>> So no by-pass. You just can't use it.
>>
>> so how to do in pure C code ? can we use that method in D ?
>
> Yup, call malloc or do the allocation on the stack just like in
> C.
correct if I am wrong, I think malloc is on heap and is very
slow.
More information about the Digitalmars-d-learn
mailing list