lua-users home
lua-l archive

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


> I am not concerned about performance at this point. Rather, I am 
thinking of platform compatibility and Lua VM integrity. If there were 
cases when calling 'error' (as a matter of exception) would leave Lua VM 
is a state unsuitable for further execution I would like to know about 
them. Not having proper GC in such cases would also be my concern.

> I am exploring this for unrolling Lua call stack to a given level. But 
after it happens I intend to proceed with executing other Lua code as if 
the unrolling had never happened.

This mechanism has worked just fine for me. I cannot see any reason why it 
would cause problems -- I looked through the VM code carefully before I 
deployed it.

As far as I know, setjmp and longjmp are required by ANSI C. This doesn't 
mean they are implemented perfectly on every architecture, but since they 
are used by so many big packages, it seems unlikely that they wouldn't 
work in the case of Lua.

This style of programming is precisely the reason I prefer automatic 
garbage collection -- Lua will not leak memory, I am sure, but you should 
watch out for any C libraries that you longjmp through on callbacks.

R.