Aspects


vs


Alloca

Alloca is a function to allocate dynamically memory on the Stack in C

Malloc

The malloc function performs dynamic memory allocation in C and is part of the standard library

Others

Quality Example
Smaller resource

"While alloca gives you automatic de-allocation on function exit the stack is usually a smaller resource than the malloc heap and if you exhaust the heap it gives you back null"

from question "Stack based array declaration in Objective-C?"

Back to Home
Data comes from Stack Exchange with CC-BY-SA-3.0