memory.js 309 B

1234567891011121314151617
  1. 'use strict';
  2. const { Cu } = require("chrome");
  3. const memory = require('../deprecated/memory');
  4. const { defer } = require('../core/promise');
  5. function gc() {
  6. let { promise, resolve } = defer();
  7. Cu.forceGC();
  8. memory.gc();
  9. Cu.schedulePreciseGC(_ => resolve());
  10. return promise;
  11. }
  12. exports.gc = gc;