> 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.