Skip to content

worker: keep allocators for transferred SAB instances alive longer

Keep the ArrayBuffer::Allocator behind a SharedArrayBuffer instance alive for at least as long as the receiving Isolate lives, if the SharedArrayBuffer instance isn’t already destroyed through GC.

This is to work around the fact that V8 7.9 started refactoring how backing stores for SharedArrayBuffer instances work, changing the timing of the call that releases the backing store to be during Isolate disposal.

The flag added to the test is optional but helps verify that the backing store is actually free’d at the end of the test and does not leak memory.

Fixes: https://github.com/nodejs/node-v8/issues/115

Checklist
  • make -j4 test (UNIX), or vcbuild test (Windows) passes
  • tests and/or benchmarks are included
  • commit message follows commit guidelines

Merge request reports

Loading