lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]


In some application one knows for certain that the lua-C stack should be 
clear.  For instance, when lua only runs in response to and event of some 
sort you can clear the stacks before sending the event to lua.

I guess guess the best thing to do is actually manage the stack with 
lua_beginblock and lua_endblock statements, but is there anything wrong 
with using lua_cstack_reset in such cases?

in lua 3.1 something like this seemed to work:
void lua_reset(){
   // zero the cstack
   lua_state->Cstack.base=0;
   lua_state->Cstack.lua2C=0;
}