lua-users home
lua-l archive

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


Title: RE: efficient calling of lua code

> Just define some functions in Lua code, dobuffer only once,
> and call the Lua
> functions from C++ code... The Lua functions don't vanish
> anywhere after
> dobuffer returns.

And lua_ref the functions you call, for faster access
(instead of a getglobal each time). If you pass, say, strings
to these functions, you might also want to lua_ref those
strings, as otherwise Lua will re-intern them each time.

--
Vincent Penquerc'h