Actually the "long jump" does NOT destroy the call stack: it goes to some piece of code that will save the call stack state, before foing to another suitable and runnnable coroutine for which it will restore its call stack.
Apologies, I should have been more precise. What I meant by “destroy” was that a C long jump discards the C stack frames for any C functions called after the context used for the long jump. I was not referring to the Lua stack, which of course is managed outside of the C setjmp/longjmp mechanism.
—Tim
|