Skip to content

Commit

Permalink
Call love.jitsetup during thread initialization too.
Browse files Browse the repository at this point in the history
  • Loading branch information
MikuAuahDark committed Nov 27, 2023
1 parent da3fdba commit f4f3105
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions src/modules/thread/LuaThread.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@

#ifdef LOVE_BUILD_STANDALONE
extern "C" int luaopen_love(lua_State * L);
extern "C" int luaopen_love_jitsetup(lua_State * L);
#endif // LOVE_BUILD_STANDALONE

namespace love
Expand Down Expand Up @@ -54,6 +55,13 @@ void LuaThread::threadFunction()
luaL_openlibs(L);

#ifdef LOVE_BUILD_STANDALONE
// Call LuaJIT-specific setup again. While it's quite late to call it at
// this point, it still needed to turn off JIT compilation (if necessary)
// for this thread.
luax_preload(L, luaopen_love_jitsetup, "love.jitsetup");
luax_require(L, "love.jitsetup");
lua_pop(L, 1);

luax_preload(L, luaopen_love, "love");
luax_require(L, "love");
lua_pop(L, 1);
Expand Down

0 comments on commit f4f3105

Please sign in to comment.