页面

2010-02-12

函数调用栈

一般程序被调用都会把函数运行时状态空间存到一个栈中,每一个函数调用占一段,叫做帧(frame)。下面摘自维基:
A call stack is composed of stack frames (sometimes called activation records). These are machine dependent data tructures containing subroutine state information. Each stack frame corresponds to a call to a subroutine which has not yet terminated with a return. For example, if a subroutine named DrawLine is currently running, having just been called by a subroutine DrawSquare, the top part of the call stack might be laid out like this (where the stack is growing towards the top):

没有评论: