Commit 7899a96e authored by Anna Henningsen's avatar Anna Henningsen Committed by Rich Trott
Browse files

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
PR-URL: https://github.com/nodejs/node/pull/29637


Reviewed-By: default avatarRich Trott <rtrott@gmail.com>
Reviewed-By: default avatarMichaël Zasso <targos@protonmail.com>
Reviewed-By: default avatarBen Noordhuis <info@bnoordhuis.nl>
parent 355f2ad4
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment