Quellcodebibliothek Statistik Leitseite products/Sources/formale Sprachen/C/Firefox/js/xpconnect/tests/unit/   (Browser von der Mozilla Stiftung Version 136.0.1©)  Datei vom 10.2.2025 mit Größe 1 kB image not shown  

Quelle  test_onGarbageCollection-05.js   Sprache: JAVA

 
// Test that the onGarbageCollection hook reports its gc cycle's number (aka the
// major GC number) and that it is monotonically increasing.

const root = newGlobal();
const dbg = new Debugger();
const wrappedRoot = dbg.addDebuggee(root)

Services.prefs.setBoolPref("security.allow_eval_with_system_principal"true);
registerCleanupFunction(() => {
  Services.prefs.clearUserPref("security.allow_eval_with_system_principal");
});

function run_test() {
  do_test_pending();

  let numFired = 0;
  let lastGCCycleNumber = undefined;

  (function loop() {
    if (numFired == 10) {
      dbg.memory.onGarbageCollection = undefined;
      dbg.enabled = false;
      return void do_test_finished();
    }

    dbg.memory.onGarbageCollection = data => {
      print("onGarbageCollection: " + uneval(data));

      if (numFired != 0) {
        equal(typeof lastGCCycleNumber, "number");
        equal(data.gcCycleNumber - lastGCCycleNumber, 1);
      }

      numFired++;
      lastGCCycleNumber = data.gcCycleNumber;

      executeSoon(loop);
    };

    root.eval("gc(this)");
  }());
}

Messung V0.5
C=97 H=100 G=98

¤ Dauer der Verarbeitung: 0.2 Sekunden  ¤

*© 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.