Eine aufbereitete Darstellung der Quelle

 
     
 
 
Anforderungen  |   Konzepte  |   Entwurf  |   Entwicklung  |   Qualitätssicherung  |   Lebenszyklus  |   Steuerung
 
 
 
 

Benutzer

Quelle  weak-marking-revealed.js

  Sprache: JAVA
 

// This is really just a minimal example of how to ensure that the weak marking
// mode is required.

gczeal(0);

function big_graph() {
  const root = {};
  let obj = root;
  for (let i = 0; i < 100000; i++) {
    obj = obj.o = {};
  }
  return root;
}

// "Hide" a large graph behind a WeakMap so that it gets traversed in weak
// marking mode.
//
// Whichever weakmap is traced first (almost certainly wm1 here) will have an
// unmarked key (mid2) that maps to the big graph. But that key is not reachable
// until the other weakmap is traced, so it will only happen when weak marking
// mode is entered.
var wm1 = new WeakMap();
var wm2 = new WeakMap();
var keys = [{}, {}];
var mid1 = {};
var mid2 = {};
var big1 = big_graph();
var big2 = big_graph();
gc();

wm1.set(keys[0], mid1);
var big = big_graph();
wm2.set(mid1, big1);
wm2.set(keys[1], mid2);
wm1.set(mid2, big2);
addMarkObservers([ big1, big2, mid1, mid2 ]);
big1 = big2 = null;
mid1 = mid2 = null;
gc();
var marks = JSON.stringify(getMarks());
print("Marks: " + marks);
assertEq(marks, '["black","black","black","black"]');

Messung V0.5 in Prozent
C=80 H=69 G=74

¤ Dauer der Verarbeitung: 0.3 Sekunden  ¤

*© Formatika GbR, Deutschland






Wurzel

Suchen

PVS Prover

Isabelle Prover

NIST Cobol Testsuite

Cephes Mathematical Library

Vienna Development Method

Haftungshinweis

Die Informationen auf dieser Webseite wurden nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit, noch Qualität der bereit gestellten Informationen zugesichert.

Bemerkung:

Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.






                                                                                                                                                                                                                                                                                                                                                                                                     


Neuigkeiten

     Aktuelles
     Motto des Tages

Open Source Software

     Quellcodebibliothek
     Eigene Quellcodes
     Fremde Quellcodes
     Suchen

Jenseits des Üblichen ....
    

Besucherstatistik

Besucherstatistik

Statistik
#Sources=277311
#Domains=752002