Does 'D' language supports 'C' like VLA?

via Digitalmars-d digitalmars-d at puremagic.com
Tue Apr 14 04:34:30 PDT 2015


On Tuesday, 14 April 2015 at 08:52:19 UTC, Jacob Carlborg wrote:
> On 2015-04-14 10:33, "Ola Fosheim =?UTF-8?B?R3LDuHN0YWQi?= 
> <ola.fosheim.grostad+dlang at gmail.com>" wrote:
>
>> No.
>
> "No" as in "alloca" doesn't work like that for default 
> arguments or a string mixin is still needed?

I've got a feeling "alloca" is very close to "compiler 
implementation defined" so the safest thing is to treat it like a 
low level compiler optimization and do it explicitly in the top 
of a non-inlined function.

I'm not even sure what happens in various D-compilers when they 
inline? Do they detect that there is an alloca there and create a 
"fake" stack frame for it or are they naive and repeatedly extend 
the stack frame inside loops when the functions inside the loops 
are inlined?


More information about the Digitalmars-d mailing list