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

Steven Schveighoffer via Digitalmars-d digitalmars-d at puremagic.com
Mon Apr 13 12:10:28 PDT 2015


On 4/13/15 2:55 PM, bearophile wrote:
> Steven Schveighoffer:
>
>> It's very unlikely this will make it into the language. Alloca should
>> be good enough for this, it's not a very common usage, and supporting
>> it is not easy.
>
> alloca is bug-prone and unsafe, and if you want to create a 2D array on
> the stack it's not good enough.
> They are uncommonly used because they are not supported by the D
> compiler, and it doesn't track the memory ownership well enough.
> But a well designed system language needs to push programmers to use the
> stack as much as possible.

It would be nice if alloca could be wrapped so it could be made safe(r).

-Steve


More information about the Digitalmars-d mailing list