tor-browser

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

bug-1894012.js (497B)


      1 // Exercise the generateMissingAllocSites feature by enabling it an allocating
      2 // a bunch of GC things.
      3 //
      4 // Run this with JS_GC_REPORT_PRETENURE=0 to see data about the generated sites.
      5 
      6 gcparam('generateMissingAllocSites', 1);
      7 gcparam('minNurseryBytes', 1024 * 1024);
      8 gcparam('maxNurseryBytes', 1024 * 1024);
      9 gc();
     10 
     11 let a = [];
     12 
     13 for (let i = 0; i < 10000; i++) {
     14  let n = new Number(i);
     15  let s = n.toString();
     16  let r = s + s;
     17  a.push([n, s, r]);
     18 }
     19 
     20 gcparam('generateMissingAllocSites', 0);