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


Quelle  dedupeTenuredBase.js   Sprache: JAVA

 
function str(c) {
  let s = c;
  for (let i = 0; i < 30; i++) {
    s += c;
  }
  ensureLinearString(s);
  return s;
}

function f() {
  // Create some slots to write into.
  const o = { owner: "short1", s: "short2" };

  // Make a tenured rope.
  const r1 = str("a") + str("b");
  gc();

  // Write the first instance of our duplicate string into one of the slots
  // (`owner`). This will be scanned first, and entered into deDupSet when
  // tenured.
  o.owner = ensureLinearString(str("a") + str("b") + str("c"));

  // Make another rope with identical contents, with a tenured subtree.
  const r2 = r1 + str("c");

  // Linearize the new rope, creating a new extensible string and a bunch of
  // dependent strings replacing the rest of the rope nodes.
  ensureLinearString(r2);

  // Write the new rope into a slot, so that it will be scanned next during the
  // minor GC during traceSlots().
  o.s = r2;

  // Do a nursery collection. o.owner will be tenured and inserted into
  // deDupSet. Then o.s aka r2 will be tenured. If things work correctly, r2
  // will be marked non-deduplicatable because it is the base of a tenured
  // string r1. If not, it will be deduplicated to o.owner.
  minorgc();

  // Extract out that r1 child node. If its base was deduplicated, this will
  // assert because its chars have been freed.
  const s1 = r1.substr(0, 31);
}

f();

Messung V0.5
C=93 H=92 G=92

¤ Dauer der Verarbeitung: 0.1 Sekunden  (vorverarbeitet)  ¤

*© Formatika GbR, Deutschland






Wurzel

Suchen

Beweissystem der NASA

Beweissystem Isabelle

NIST Cobol Testsuite

Cephes Mathematical Library

Wiener Entwicklungsmethode

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

Software

     Produkte
     Quellcodebibliothek

Aktivitäten

     Artikel über Sicherheit
     Anleitung zur Aktivierung von SSL

Muße

     Gedichte
     Musik
     Bilder

Jenseits des Üblichen ....
    

Besucherstatistik

Besucherstatistik

Monitoring

Montastic status badge