V2EX  ›  英汉词典

Call Stack

Definition / 定义

调用栈:程序运行时用来管理函数(或方法)调用顺序的一块内存结构。每次调用函数会创建一个“栈帧(stack frame)”并压入栈中;函数返回时对应栈帧弹出。它常用于保存返回地址、参数、局部变量等信息。也常用来指“栈追踪/调用链”(例如错误信息里的调用顺序)。

Pronunciation / 发音

/ˈkɔːl stæk/

Examples / 例句

The call stack shows which function is running now.
调用栈会显示当前正在运行的是哪个函数。

When the program crashed, the debugger printed a call stack that traced the error back through several nested function calls.
程序崩溃时,调试器打印出一份调用栈,沿着多层嵌套的函数调用把错误追溯到源头。

Etymology / 词源

“Call stack”由 call(调用) + stack(栈) 组成:call 表示“调用某个函数/过程”,stack 指“后进先出(LIFO)”的数据结构。组合起来就形象地表达了“函数调用按栈的方式进出”的运行机制。该术语随现代编程语言与操作系统的普及而广泛使用。

Related Words / 相关词

Literary Works / 著名作品

  • Computer Systems: A Programmer’s Perspective(Randal E. Bryant, David R. O’Hallaron)——讲解过程调用、栈帧与调用栈在体系结构层面的实现
  • The C Programming Language(Brian W. Kernighan, Dennis M. Ritchie)——涉及函数调用与栈相关概念(虽不总以“call stack”作为固定词组呈现)
  • Structure and Interpretation of Computer Programs(Harold Abelson, Gerald Jay Sussman)——讨论过程调用与求值模型,常引出对调用栈/控制栈的理解
  • Debugging: The 9 Indispensable Rules for Finding Even the Most Elusive Software and Hardware Problems(David J. Agans)——调试实践中经常使用“stack trace / call stack”来定位错误
关于   ·   帮助文档   ·   自助推广系统   ·   博客   ·   API   ·   FAQ   ·   Solana   ·   2128 人在线   最高记录 6679   ·     Select Language
创意工作者们的社区
World is powered by solitude
VERSION: 3.9.8.5 · 13ms · UTC 11:28 · PVG 19:28 · LAX 03:28 · JFK 06:28
♥ Do have faith in what you're doing.