Tool/software: TI C/C++ Compiler
Hi
I need to disable VLA allocation because our HEAP size is not enough to allocate the VLA block.
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.
Tool/software: TI C/C++ Compiler
Hi
I need to disable VLA allocation because our HEAP size is not enough to allocate the VLA block.
There is no method that disables only VLA.
The VLA feature is part of the C11 standard. The TI compiler supports the C89 standard by default, and other standards as extensions. Thus, you could consider using the option --strict_ansi, which disables all language extensions. If VLA is the only language extension your code uses, that could work. If your code uses other language extensions, then this may not work.
If you do go with --strict_ansi, please understand that adding --c11 causes the compiler to support the C11 standard, which includes VLA. Thus, under the combination of options --strict_ansi --c11, VLA is supported.
Thanks and regards,
-George
Unfortunately, there is no command line option.
As you've discovered, this preprocessor symbol ...
#define NORMAL_BLOCK_SIZE 32700
... is defined in the RTS source file vla_alloc.c. You could consider changing it, and rebuilding the RTS library. However, you would have to remember to do that every time you upgrade the compiler. I presume this is not practical.
Thanks and regards,
-George
Yes - I would rather not have a patch to the compiler. I guess I would just need to remove the VLA usages from the code manually.
Is it possible to push this request (configurable VLA block size) for the next compiler version?
Richa Sahasrabudhe1 said:Is it possible to push this request (configurable VLA block size) for the next compiler version?
I filed the entry EXT_EP-9729 to request this change in the compiler. You are welcome to follow it using the link below in my signature.
Thanks and regards,
-George