fix: allocate playthrough identity only on demand

This commit is contained in:
MaxTomahawk
2026-08-07 15:01:18 +02:00
parent 6e94625f2a
commit 49954ec4ad
6 changed files with 80 additions and 39 deletions
+7
View File
@@ -41,6 +41,13 @@ local function serialize(v, indent)
error("cannot serialize " .. t)
end
-- LuaJIT 2.1 can lose a just-added nested table entry when a GC step lands
-- inside a compiled recursive serialization trace. The symptom is valid input
-- becoming `{" followed by only the trailing comma, which then cannot be read
-- back. Save encoding is infrequent and I/O-bound, so keep this correctness-
-- critical recursion in the interpreter while leaving the game JIT enabled.
if jit and jit.off then jit.off(serialize, true) end
function SaveSerializer.encode(data)
return "return " .. serialize(data) .. "\n"
end