News for hackers. Stuff that matters.
Re: by gpderetta on Tuesday April 30, 2024 @06:39AM (#40209439)
key being "safely placed". VLAs and allocas keep being deprecated everywhere as they are a time bomb.

In practice you need safe upperbound for VLAs and alloca, so you might as well just allocate the upper bound as a fix size array outright. If you do not initialize the array, there is no real additional cost other than the additional stack probes. On GCC at least, alloca and VLAs disable some optimizations (like inlining) so it is really a wash.

If you need truly unbounded size allocations, you need an heap fallback anyway.

There are no comments on this comment yet.