luagc: incremental GC module (disabled), realistic AllocBench

Incremental GC: atomic mark + batched rootgc sweep. Crashes from
objects born white during sweep -- needs birth-mark barrier fix.
Link hook (luaC_link) calling convention verified but interaction
with sweep_ptr at list head needs solving. Disabled pending fix.

AllocBench: realistic addon-like data structures (combat events,
player damage breakdowns with metatables, aura trackers with
closures). Cross-references shared spell/unit caches. These
complex structures reveal GC as the true stutter source -- simple
flat objects don't trigger meaningful GC pauses.

Removed arena pre-reservation (was fragmenting 32-bit address space).
This commit is contained in:
MarcelineVQ
2026-04-05 10:35:24 -07:00
parent deaeaa1450
commit 4e0a1934fb
4 changed files with 705 additions and 2 deletions
+6 -1
View File
@@ -43,6 +43,7 @@ const clip_sse = @import("clip_sse.zig");
const cull_sse = @import("cull_sse.zig");
const silicon_sse = @import("silicon_sse.zig");
const luaalloc = @import("luaalloc.zig");
const luagc = @import("luagc.zig");
const renderParticleSprites_SSE = particle_sse.renderParticleSprites_SSE;
const resetParticleCache = particle_sse.resetParticleCache;
@@ -326,7 +327,10 @@ pub fn installHooks() void {
if (inflate_hook.install()) installed += 1;
// Lua slab allocator replacement
installed += luaalloc.install();
// installed += luaalloc.install(); // disabled for testing
// Incremental GC -- disabled, needs more research
// installed += luagc.install();
}
pub fn lateInit() void {
@@ -336,6 +340,7 @@ pub fn lateInit() void {
pub fn removeHooks() void {
if (g_is_hook_owner) {
luaalloc.dumpStats(); // dump size histogram before unhooking
filecache.remove();
inflate_hook.remove();
transform_hook.detach();