[Date Prev][Date Next][Thread Prev][Thread Next]
- Subject: RE: Stack level doesn't match hook events
- From: "Tom Spilman" <tom@...>
- Date: Sat, 18 Sep 2004 03:06:43 -0500
> -----Original Message-----
> From: firstname.lastname@example.org
> [mailto:email@example.com] On Behalf Of Rici Lake
> Sent: Saturday, September 18, 2004 1:22 AM
> To: Lua list
> Subject: Re: Stack level doesn't match hook events
> This is a tail call; it is effectively optimised into a jump.
> So the caller of the_page_stack:restore_device_objects() has
> been removed from the stack before the function is called.
To wrap this thread up. What seemed like the right thing to do, count
LUA_HOOKCALLs to keep track of the stack depth, is a bad idea. First
because LUA_HOOKCALL changes meaning when it's a tail call as the stack
depth doesn't change (how about a LUA_HOOKTAILCALL?). Second depending on
the complexity of your script the hooks add up. Our 2d game which is almost
completely Lua script went from ~20fps while the debugger is connected to
over 200fps when I removed the call/return events from the hook.
Co-owner | Programmer