So, what does this buy us? Well, quite a lot, as it turns out. Conceptually, virtual and physical memory is divided into chunks called pages. A virtual address space is used that is backed by physical memory. Memory in modern systems is not accessed directly. As we go deep into the call graph, more frames are allocated, which increases the size of the call stack. It usually includes function arguments, the return address, and local data. A stack frame consists of data relevant to a particular function. Within a call stack, we can find a series of stack frames. Certain architecture-dependent conventions define what states are saved by caller and callee during execution. For this purpose, we use a call stack that is based on the stack data structure. In either case, we can describe program execution flow with a call graph of callers and callees.Īs we follow the program execution, we need to save states for the transfer of control among functions. A recursive (reentrant) function can also call itself. Programs usually consist of many functions, which in turn can call other functions. The stack data structure can be useful in expression evaluation/conversion, syntax checking, order reversing, backtracing, and function calls. We can perform push to add an item onto the stack and pop to remove one.
0 Comments
Leave a Reply. |