mirror of
https://github.com/vercel-labs/scriptc.git
synced 2026-10-21 05:50:55 +08:00
Worker programs sent every typed-array element read and write through scr_bytes_get/scr_bytes_set, which take the shared-memory lock guard even for buffers no other thread can see (4% of a Worker build of the tsc-ts self-check). A view's `shared` storage is fixed before script code can see it, so the emitted access now tests it: SharedArrayBuffer views keep the locked runtime call, every other view takes the ordinary inline path of non-worker programs. The new corpus program reads and writes own and shared views through the same functions (clamping, wrapping, float narrowing, out-of-range and negative indices) on both threads.