Stack vs Heap

Back: Memory Models

The two primary regions of memory used by programs. The stack provides fast, automatic allocation for function-scoped data, while the heap supports dynamic, long-lived allocations that can outlive their creating scope.

Concepts


memory-models stack heap