This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

Avoid __vla_alloc for a local array defined inside a function



Hi Compiler Gurus,

I am declaring an array inside a function whose length is specified by a global constant. Looking at the dis-assembly, I noticed that the compiler is making a __vla_alloc call to allocate memory for the array. Since this function is on the critical path, I need to avoid any memory allocation calls inside it. Is there a way I can continue to use the global constant to specify the array length but avoid the alloc call ? I know I can use an integer literal to specify the array length but want to purposely avoid that as the array length is statically configurable at build time.

Best,

Ashish

Edit: I am using TI's ARM compiler and the target is Cortex-R5