setjmp/longjmp

Lesson overview

Topics covered: non-local jumps, saving stack state.

setjmp/longjmp

setjmp(env) - save current stack context
longjmp(env, val) - restore and resume
Used for non-local jumps, error handling cleanup

Article author: Arthur Isaev

Banner image