blob: ef1d5e36fd7aa0e323713190f1f13378a2522f62 [file] [log] [blame]
// Equivalent of running node with --expose-gc
// but easier to write tooling since we don't need to inject that arg to
// nodejs_binary
// TODO: reconsider this once we support multiplex workers
// and workers are run via worker_threads
if (typeof global.gc !== 'function') {
// tslint:disable-next-line:no-require-imports
require('v8').setFlagsFromString('--expose_gc');
// tslint:disable-next-line:no-require-imports
global.gc = require('vm').runInNewContext('gc');
}