Activation Stack

The activation stack is where the run time environment of the program keeps track of all the functions that have been called. The activation stack records all the necessary information about a function call, including parameters, local variables, return values, location currently being executed in the function, etc. As one function calls a function, which in turn calls another function, which call yet another function, all of this information is stored in the activation stack.

Activation Stack

A Stack refers to a method of placing one thing on top of another. In a cafeteria, the clean trays are placed in a stack, one after the other, and the most recently cleaned tray is on top of the stack, waiting for your use. Of course this means the tray that was cleaned longest ago is on the bottom of the stack.

As your program calls more and more "functions" the computer keeps track of this information in an "Activation Stack" (a list of all functions in the order they were called, where in the function they are, and what information is associated with them). This represents the "State" of your program. You often want to see how one function called previously has affected the "current" function. To do this, click (in the Debug window) on the STACK pull down menu. By selecting the names of the functions you "move up and down on this list" and thus see how your program "got" to where it currently is!

Activation Record

The activation record is a "chunk of memory" (a bunch of buckets) which contains all the information necessary to keep track of a "function call". This includes buckets for the parameters of the function, for the return value of the function, for the local variables of the function, and for which line in the function is currently being executed.

Activation records are stored on the "Activation Stack" so that when the current function is executing, we have a record of "where what came before".


Back to Topics List