tor-browser

The Tor Browser
git clone https://git.dasho.dev/tor-browser.git
Log | Files | Refs | README | LICENSE

Memory-drainAllocationsLog-06.js (498B)


      1 // Test doing a GC while we have a non-empty log.
      2 
      3 const root = newGlobal({newCompartment: true});
      4 const dbg = new Debugger();
      5 dbg.addDebuggee(root)
      6 dbg.memory.trackingAllocationSites = true;
      7 
      8 root.eval("(" + function immediate() {
      9  this.tests = [
     10    ({}),
     11    [],
     12    /(two|2)\s*problems/,
     13    new function Ctor(){},
     14    new Object(),
     15    new Array(),
     16    new Date(),
     17  ];
     18 } + "());");
     19 
     20 gc();
     21 
     22 const allocs = dbg.memory.drainAllocationsLog();
     23 assertEq(allocs.length >= root.tests.length, true);