Parallelize Lua GC

uramer
2026-03-31T13:16:07Z

1. separate the first few lines of LuaManager::update() into a separate method
2. expose it through MWLua::Worker with a gc() and finishGc() methods
3. run it and wait for it at the correct parts of the frame in engine.cpp

Ideally we should stop GCing (only wait for the current GC step) after the other engine threads finished. Currently we have a hard-coded amount of GC steps, this way we could do as much GC as we are "allowed" to by the other parts of the engine