tor-browser

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

elements-post-write-barrier.js (466B)


      1 gczeal(12);
      2 
      3 var length = 10000;
      4 var array = new Array(length);
      5 array.fill(null);
      6 
      7 // Promote the array to the tenured heap, if it isn't already there.
      8 minorgc();
      9 
     10 for (var i = 0; i < length; i++) {
     11  // Exercise that barrier with some fresh nursery object references!
     12  array[i] = {};
     13 }
     14 
     15 minorgc();
     16 
     17 for (var i = length; i > 0; i--) {
     18  array[i - 1] = {};
     19 }
     20 
     21 minorgc();
     22 
     23 for (var i = 0; i < length; i++) {
     24  array[Math.floor(Math.random() * length)] = {};
     25 }
     26 
     27 gc();