acquireStateLock was allocating a fresh SharedArrayBuffer on every retry iteration via Atomics.wait(new Int32Array(new SharedArrayBuffer(4)), ...). The buffer is never mutated and never escapes, so hoisting it before the loop is a provably-equivalent transformation — Atomics.wait always sees value 0 whether the buffer is fresh or reused. Fixes #316 Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
230 B
230 B
type, pr
| type | pr |
|---|---|
| Fixed | 316 |
acquireStateLock no longer allocates a fresh SharedArrayBuffer on every retry iteration — the sleep buffer is now hoisted before the retry loop and reused, eliminating per-retry heap pressure. (#316)