The stack
Any time we call a function or a method, the stack is used for allocating space for values that are created within the function. All of the let bindings in your functions are stored in the stack, either as values themselves or as pointers to memory locations on the heap. These values constitute the stack frame for the active function. A stack frame is a logical block of memory in the stack that stores the context of a function call. This context may include function arguments, local variables, return addresses, and any saved register's values that need to be restored after returning from the function. As more and more functions get called, their corresponding stack frames are pushed onto the stack. Once a function returns, the stack ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access