[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: Creating a default error handler for lua_pcall
- From: Lee Hickey <lahickey@...>
- Date: Tue, 27 Mar 2007 11:01:25 +0100
Rici Lake wrote:
Lee Hickey wrote:
Thanks. What I forgot to mention is that I want to remove the
overhead of having to insert this extra parameter for every pcall. My
game engine makes many pcalls and I would rather have each of these
calls be as cheap as possible. This need isn't based on any kind of
profiling, so I am guilty of a little blind optimising, but many
unnecessary lua_inserts per frame seems like a sensible thing to
avoid if at all possible.
Regards,
Lee.
It's probably not that expensive. But you might want to try to cut
down on the number of pcalls, for example by using an "outer pcall"
which calls function which performs a sequence of lua functions. (Of
course, you could also seek & destroy C functions which don't conform
to your stack guidelines.)
Thanks for the suggestions. Both of those things will work of course,
and I'll do both, however, I can't help feeling there should be a way to
set up a default error handler. A pseudo-index type approach seems like
a sensible way, so I think I'll have a play at adding that in. Has there
been any work done on customisable pseudo-indices?
Regards,
Lee