MCPcopy Index your code
hub / github.com/dawn-gpu/node-webgpu / waitForGC

Function waitForGC

test/tests/reference-count-tests.js:7–16  ·  view source on GitHub ↗
(ref, label)

Source from the content-addressed store, hash-verified

5const debug = DEBUG('reference-count-tests');
6
7async function waitForGC(ref, label) {
8 assert(global.gc, 'global.gc is not exposed. use --expose-gc');
9 // wait for the device to be collected
10 while (ref.deref()) {
11 debug('gc');
12 global.gc();
13 await new Promise(resolve => setTimeout(resolve, 1000));
14 }
15 debug(label, 'was GCed');
16}
17
18await describe('reference count tests', async () => {
19

Callers 1

Calls

no outgoing calls

Tested by

no test coverage detected