Browse Source

Revert "Improves the LuaJIT performance by using luaL_openlibs to initialize the VM"

This reverts commit 1e8f89a8fa.
tags/v1.3.0
Leonardo Laguna Ruiz Andrew Belt 5 years ago
parent
commit
c68b38aa64
1 changed files with 6 additions and 10 deletions
  1. +6
    -10
      src/LuaJITEngine.cpp

+ 6
- 10
src/LuaJITEngine.cpp View File

@@ -28,16 +28,12 @@ struct LuaJITEngine : ScriptEngine {
return -1;
}

// Import the common Lua libraries
luaL_openlibs(L);
// Unloads the unsafe libraries
lua_pushinteger(L, 0);
lua_setglobal(L, "os");
lua_pushinteger(L, 0);
lua_setglobal(L, "io");
// Unloads 'require' so 'io' and 'os' cannot be reloaded
lua_pushinteger(L, 0);
lua_setglobal(L, "require");
// Import a subset of the standard library
luaopen_base(L);
luaopen_string(L);
luaopen_table(L);
luaopen_math(L);
luaopen_bit(L);

// Set user pointer
lua_pushlightuserdata(L, this);


Loading…
Cancel
Save