Quellcodebibliothek Statistik Leitseite products/sources/formale Sprachen/C/Firefox/js/src/jit-test/tests/sharedbuf/   (Browser von der Mozilla Stiftung Version 136.0.1©)  Datei vom 10.2.2025 mit Größe 668 B image not shown  

Quelle  slice-same-memory.js   Sprache: JAVA

 
// |jit-test| skip-if: !this.SharedArrayBuffer

load(libdir + "asserts.js");

var sab = new SharedArrayBuffer(1 * Int32Array.BYTES_PER_ELEMENT);

// Make a copy, sharing the same memory
var sab2 = (setSharedObject(sab), getSharedObject());

// Assert it's not the same object
assertEq(sab === sab2, false);

// Assert they're sharing memory
new Int32Array(sab)[0] = 0x12345678;
assertEq(new Int32Array(sab2)[0], 0x12345678)

sab.constructor = {
  [Symbol.species]: function(length) {
    return sab2;
  }
};

// This should throw because the buffer being sliced shares memory with the new
// buffer it constructs.
assertThrowsInstanceOf(() => sab.slice(), TypeError);

Messung V0.5
C=90 H=97 G=93

¤ Dauer der Verarbeitung: 0.3 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.