The stack segment is where data needed for program execution is kept, like thread-local variables, function arguments (depending on the calling convention), etc. Each thread has its own stack for thread safety purposes (though the main heap is shared).

There are different ways in which a stack is laid out. Stacks can be “full” or “empty.” A full stack’s stack pointer points to the current top element, whereas an empty stack’s stack pointer points after the top element (i.e., unoccupied space). Stacks can also be classified by their direction of growth: ascending or descending. x86 systems have full descending stacks, so the stack grows downwards, meaning that new elements pushed onto the stack will have a lower memory address.