Downstream evidence: zig-utils/zig-js#62
Problem
Every managed-cell allocation inserts its payload address into the heap's exact live-payload index. The index currently uses std.AutoHashMapUnmanaged(usize, *Header), whose generic integer auto-hash runs Wyhash for each already-aligned pointer. A symbolized allocation-churn profile in zig-js attributes most Heap.create samples to indexPayloadLocked, making hash/index maintenance the dominant collector-side allocation cost rather than slab allocation itself.
Scope
- retain the exact payload-to-header hash index and its safe all-list fallback;
- replace generic integer auto-hashing with a well-distributed pointer-specialized mixer that discards guaranteed alignment bits;
- preserve insertion, lookup, removal, OOM fallback, parallel allocation locking, concurrent marking, sweep, and teardown behavior;
- measure the downstream allocation-heavy workload before and after;
- avoid changing public collector semantics or requiring embedder changes.
Acceptance criteria
- Exact managed-payload lookup and wild/stale-pointer rejection remain covered.
- Allocation, sweep removal, collection, and deinit keep index membership correct.
- Parallel/concurrent collector tests remain race-safe.
- The downstream bounded-object-churn benchmark materially improves with identical checksums.
- Full zig-gc tests pass; batch TSan with the downstream publication gate.