Stack vs Heap, Simply
Where values live and why it matters.
Two Places for Data
Every value in your program lives somewhere in memory. Mojo uses two regions: the stack and the heap. 🧠
The Stack
The stack is a fast, orderly pile of memory. Local variables go here, and they vanish automatically when a function returns.
All lessons in this course
- Stack vs Heap, Simply
- Pointers Without Fear
- Owning Heap Buffers
- Avoiding Common Memory Bugs