Todos los libros

Profesional

Apps Acerca de Coach Iniciar sesión Empezar a leer

Computer Science · Glosario

¿Qué es Stack unwinding?

Definition 1.15 University Computer Science — Year 2 · Capítulo 1 — From C to C++: Classes and Resource Management

Between a throw and the handler that catches it, the program leaves every block and every function in between. Stack unwinding is this departure: each frame left is popped, and each automatic object of each block left is destroyed, in the reverse order of construction, as if its block had ended.

The frames of  when parse(3) throws, the newest on top. Unwinding pops frames downward to the frame whose try block has a matching handler, destroying each object it passes, then runs the handler.
The frames of Listing 1.10 when parse(3) throws, the newest on top. Unwinding pops frames downward to the frame whose try block has a matching handler, destroying each object it passes, then runs the handler.
Leer en el capítulo →