Stacks in computing architectures are regions of memory where data is added or removed in a last-in-first-out (LIFO) manner.
In most modern computer systems, each thread has a reserved region of memory referred to as its stack.
Another feature is that memory on the stack is automatically, and very efficiently, reclaimed when the function exits, which can be convenient for the programmer if the data is no longer required.
This conflict is typically resolved by creating a separate chain of heap storage for each call to alloca.
Many Unix-like systems as well as Microsoft Windows implement a function called alloca for dynamically allocating stack memory in a way similar to the heap-based malloc.
A compiler typically translates it to inlined instructions manipulating the stack pointer, similar to how variable-length arrays are handled.
[6] gnulib provides an equivalent interface, albeit instead of throwing an SEH exception on overflow, it delegates to malloc when an overlarge size is detected.