stack frame(栈帧):在程序运行时,调用一个函数/过程时在调用栈(call stack)上分配的一段数据区域,用来保存该次调用所需的信息,例如参数、局部变量、返回地址、保存的寄存器、上一层栈帧指针等。(也常被称为 activation record。)
/ˈstæk freɪm/
The debugger shows a new stack frame every time the function is called.
调试器会在每次函数被调用时显示一个新的栈帧。
When the program crashed, the stack trace revealed corrupted stack frames, suggesting a buffer overflow in a deeply nested call.
程序崩溃时,栈追踪显示栈帧被破坏,这暗示在深层嵌套调用中发生了缓冲区溢出。
stack 原意为“堆叠”,在计算机中指按“后进先出(LIFO)”方式管理的内存结构;frame 原意为“框架/框”,引申为“把一次函数调用所需的数据‘框’起来的一块区域”。组合成 stack frame,直观表达“调用栈上的一格/一层记录”。