Please note: We are aware of an issue affecting replies on the Arm Community forums, which may not be loading as expected.

We apologize for any inconvenience and appreciate your patience while we investigate and work to resolve the issue.

Thank you for your understanding.


This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

Why are dynamically-sized arrays implemented as malloc()?

I'm working on a project that should not use a Heap. In the process of revising my code for this, I've discovered that dynamically-sized arrays, e.g.

uint8_t my_array[MIN(input_size, MAX_SIZE)];

are automatically compiling into usages of malloc(). I've completed my code revision, but I have two questions:
Where is this behavior is documented?
Is it possible to change this so that the allocations instead happen on the Stack?

Parents Reply Children
No data