[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: RE: error, setjmp and exceptions
- From: RLake@...
- Date: Thu, 18 Dec 2003 14:33:59 -0500
> 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.