O Que É um Stack Frame?
Um stack frame é a região da pilha de chamadas empilhada quando uma função é invocada e desempilhada quando ela retorna. Ele armazena os argumentos da chamada, as variáveis locais, os registradores salvos e o endereço para onde retornar. A cadeia de frames ativos forma a pilha de chamadas que debuggers e stack traces exibem.
Por que importa
Os stack frames são o motivo pelo qual variáveis locais são limpas automaticamente no retorno e pelo qual recursão profunda ou infinita causa stack overflow. Ler os frames é central para interpretar stack traces durante o debugging.
Guias relacionados
What Is a Tail Call?A tail call is a function call that is the last action in a function, allowing the current stack frame to be…
What Is a Calling Convention in an ABI?A calling convention in an ABI defines how functions pass arguments, return values, and preserve registers so…
What Is a Continuation?A continuation represents the rest of a computation at a given point, as a value that can be invoked later to…