Parent consumer issue: zig-utils/zig-js#97
Post-quickening profiling of the exact zig-js shared object_churn row (ReleaseFast, 8 lanes) finds Heap.create at 14,907 top-of-stack samples in a five-second sample, versus GcCellBacking.allocFn at 1,936 and headerForPayload at 1,371. Heap.create serializes every parallel allocation through the single alloc_lock even when a caller can safely initialize several same-kind cells before its next safepoint.
Scope:
- add a general same-kind batch creation API that allocates private slabs first and publishes their initialized headers/list/counters under one metadata lock;
- preserve single-create behavior and allocator/OOM recovery;
- preserve nursery counters, born-grey/concurrent-mark deferral, exact payload alignment, all-list integrity, and cleanup of partial allocations;
- add direct tests for normal, nursery, OOM/partial allocation, and parallel allocation behavior;
- consume the API from zig-js fixed-shape allocation quickening and prove exact-parent direct/shared gains;
- pass zig-gc tests plus zig-js semantic, GC, TSan, and threadfuzz coverage.
Acceptance:
- batch publication takes one alloc_lock acquisition for N successfully allocated cells;
- no leaked slabs or partially published cells on failure;
- exact live/young byte and cell accounting;
- material improvement in the eight-lane shared object-churn row without direct regression.
Parent consumer issue: zig-utils/zig-js#97
Post-quickening profiling of the exact zig-js shared object_churn row (ReleaseFast, 8 lanes) finds Heap.create at 14,907 top-of-stack samples in a five-second sample, versus GcCellBacking.allocFn at 1,936 and headerForPayload at 1,371. Heap.create serializes every parallel allocation through the single alloc_lock even when a caller can safely initialize several same-kind cells before its next safepoint.
Scope:
Acceptance: