stack frame
A stack frame is a data structure used in computer programming to manage function calls and local variables. When a function is called, a new stack frame is created on the call stack, which holds information such as the function's parameters, local variables, and the return address. This organization helps keep track of where to return after the function completes.
When the function finishes executing, its stack frame is removed from the stack, freeing up memory. This process allows for efficient management of multiple function calls, enabling features like recursion and nested function calls while maintaining the correct execution order.