mirror of
https://github.com/vercel-labs/scriptc.git
synced 2026-10-31 07:23:06 +08:00
process.memoryUsage() reported external and arrayBuffers as 0. arrayBuffers is now the storage of the ArrayBuffers, typed arrays, Buffers, DataViews and SharedArrayBuffers the program holds, and external the same storage without SharedArrayBuffers, as Node splits them. A view over existing storage adds nothing. v8.getHeapStatistics().external_memory reads the same figure as external. Each ScrBytes owner records the bytes it counts in the struct's padding, so ScrBytes stays 64 bytes and the offsets compiled code reads hold; a static assertion pins them. Owners are counted in a per-instance counter, because their reference counts are not atomic and they are released on their instance's thread. Shared storage moves its owner's count to a process-wide atomic counter, since any thread may release it.