8.1 Stack Frames
The call stack is divided up into contiguous pieces called stack
frames, or frames for short; each frame is the data associated
with one call to one function. The frame contains the arguments given
to the function, the function's local variables, and the address at
which the function is executing.
When your program is started, the stack has only one frame, that of the
function main . This is called the initial frame or the
outermost frame. Each time a function is called, a new frame is
made. Each time a function returns, the frame for that function invocation
is eliminated. If a function is recursive, there can be many frames for
the same function. The frame for the function in which execution is
actually occurring is called the innermost frame. This is the most
recently created of all the stack frames that still exist.
|