From 7899a96e66a2f9bb836ca80d8264954848633a3d Mon Sep 17 00:00:00 2001 From: Anna Henningsen Date: Fri, 20 Sep 2019 23:42:31 +0200 Subject: worker: keep allocators for transferred SAB instances alive longer MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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: Rich Trott Reviewed-By: Michaël Zasso Reviewed-By: Ben Noordhuis --- test/parallel/test-worker-sharedarraybuffer-from-worker-thread.js | 1 + 1 file changed, 1 insertion(+) (limited to 'test') diff --git a/test/parallel/test-worker-sharedarraybuffer-from-worker-thread.js b/test/parallel/test-worker-sharedarraybuffer-from-worker-thread.js index 60e8a5d52a..56dfe2ec41 100644 --- a/test/parallel/test-worker-sharedarraybuffer-from-worker-thread.js +++ b/test/parallel/test-worker-sharedarraybuffer-from-worker-thread.js @@ -1,3 +1,4 @@ +// Flags: --debug-arraybuffer-allocations 'use strict'; const common = require('../common'); const assert = require('assert'); -- cgit v1.2.3