Parent downstream: zig-js #97 Related: zig-gc #29, zig-js #128
The owned-cell publication bitmap fixed classifiers observing constructing/reused slab headers, but it adds a second size-class lock acquisition after every allocation batch and one unpublication lock per dead cell before finalization. A fresh eight-lane profile at zig-js daf74724 / zig-gc 092d8d7 still places batch publication, swept-slot handling, and sweepPhaseLocked among the dominant stacks. Batch unpublication was previously rejected because holding the bucket lock across a whole dead run made peer classification latency worse.
Design
- Let an owned backing initialize the header guard word to zero while the slot is still protected by its allocation bucket lock.
- Route single-cell owned allocations through the same guarded allocation hook, so no issued owned slot ever exposes uninitialized header storage.
- Make header magic an atomic acquire/release liveness guard: publish it only after immutable header fields are initialized; clear it before finalization/reuse.
- Let owned classifiers map issued slots without a separate publication bitmap; zig-gc validates the guard before reading size/kind or treating the pointer as live.
- Preserve generic allocator bindings that do not provide exact owned/guarded storage.
Acceptance
- Exact construction/reuse/classification tests prove issued-but-zero slots classify empty and fully initialized headers classify live.
- Remove the downstream batch-publication and per-cell-unpublication bucket-lock work without weakening TSan ordering.
- Pass full zig-gc tests and focused downstream GC/OOM/no-GIL/TSan gates.
- Exact-parent downstream A/B must avoid one/two-lane regressions and materially improve four/eight-lane shared object churn; otherwise fully revert and document.