From acc8d7ea7f905fec26980677d56e6873d0128a6e Mon Sep 17 00:00:00 2001 From: Leonardo Laguna Ruiz Date: Sun, 12 Apr 2020 15:44:00 +0300 Subject: [PATCH] Improves the LuaJIT performance by using luaL_openlibs to initialize the VM (#26) * Improves the LuaJIT performance by using luaL_openlibs to initialize the VM * Revert "Improves the LuaJIT performance by using luaL_openlibs to initialize the VM" This reverts commit 1e8f89a8fa9fa965f398cccf3af4988aa91a9395. * Loads the JIT library that way the JIT engine is enabled * Fixes typo in comment --- src/LuaJITEngine.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/LuaJITEngine.cpp b/src/LuaJITEngine.cpp index 1d8d523..ee39157 100644 --- a/src/LuaJITEngine.cpp +++ b/src/LuaJITEngine.cpp @@ -34,6 +34,11 @@ struct LuaJITEngine : ScriptEngine { luaopen_table(L); luaopen_math(L); luaopen_bit(L); + // Loads the JIT package otherwise it will be off + luaopen_jit(L); + // Disables access to the JIT package + lua_pushnil(L); + lua_setglobal(L,"jit"); // Set user pointer lua_pushlightuserdata(L, this);