allow on stack with betterC

FreeSlave freeslave93 at gmail.com
Tue Oct 23 14:16:54 UTC 2018


On Tuesday, 23 October 2018 at 13:02:15 UTC, test wrote:
> On Tuesday, 23 October 2018 at 11:17:03 UTC, Dennis wrote:
>> On Tuesday, 23 October 2018 at 10:18:56 UTC, test wrote:
>>> I can not user static array because the length is a runtime 
>>> vars.
>> When compiling with dmd and -betterC I got a linker error 
>> "undefined reference to '__alloca'", but with LDC it worked 
>> fine.
>
>
>
> Thanks,  alloca is what i am look for.
>

Note however that a failure to allocate with alloca most likely 
will lead to the crash. The failure can happen in restrictive 
environments, e.g. containers. That something that I experienced 
myself. Phobos used to have this bug using alloca in Posix 
std.process code.


More information about the Digitalmars-d-learn mailing list