From c1ef484db6af1d7f865846dbc93f288648b76e3b Mon Sep 17 00:00:00 2001 From: MysterD Date: Sat, 24 Jun 2023 17:49:19 -0700 Subject: [PATCH] Revert Lua GC settings to defaults --- src/pc/lua/smlua.c | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/src/pc/lua/smlua.c b/src/pc/lua/smlua.c index b762a7c5..c61a22b1 100644 --- a/src/pc/lua/smlua.c +++ b/src/pc/lua/smlua.c @@ -297,9 +297,18 @@ void smlua_update(void) { smlua_call_event_hooks(HOOK_UPDATE); // Collect our garbage after calling our hooks. // If we don't, Lag can quickly build up from our mods. - lua_gc(L, LUA_GCCOLLECT, 0); - lua_gc(L, LUA_GCSTOP, 0); -} + /*lua_gc(L, LUA_GCSTEP, 1); + lua_gc(L, LUA_GCSTOP, 0);*/ + + // EDIT: uhh, it turns out that is not the case + // if we only do incremental garbage collection, + // eventually the garbage will build up so much + // that the game slows to a crawl. Messing with + // the GC setting is what caused Arena to get worse + // over time. + // The real fix would be to make smlua produce less + // garbage. + void smlua_shutdown(void) { hardcoded_reset_default_values();