http://thread.gmane.org/gmane.comp.lang.lua.general/84469/fo...
To summarize, use the FFI library (http://luajit.org/ext_ffi.html) which enables LuaJIT to directly access C types and functions, bypassing the Lua C API. Or, write more of your code in pure Lua, reducing usage of the Lua C API bridge.
http://thread.gmane.org/gmane.comp.lang.lua.general/84469/fo...
To summarize, use the FFI library (http://luajit.org/ext_ffi.html) which enables LuaJIT to directly access C types and functions, bypassing the Lua C API. Or, write more of your code in pure Lua, reducing usage of the Lua C API bridge.