Quellcodebibliothek Statistik Leitseite products/Sources/formale Sprachen/C/Firefox/js/src/jit-test/tests/wasm/memory64/   (Firefox Browser Version 136.0.1©)  Datei vom 10.2.2025 mit Größe 1 kB image not shown  

Quelle  memory-init.js

  Sprache: JAVA
 

// |jit-test| heavy; allow-oom; skip-if: !canRunHugeMemoryTests()

var S = (function () {
    let s = "";
    for ( let i=0; i < 16; i++ )
        s += "0123456789abcdef"
    return s;
})();

for (let shared of ['''shared']) {
    try {
        var ins = new WebAssembly.Instance(new WebAssembly.Module(wasmTextToBinary(`
(module
  (memory (export "mem") i64 65537 65537 ${shared})
  (data $d "${S}")
  (func (export "f") (param $p i64) (param $o i32) (param $n i32)
    (memory.init $d (local.get $p) (local.get $o) (local.get $n))))`)));
    } catch (e) {
        if (e instanceof WebAssembly.RuntimeError && String(e).match(/too many memory pages/)) {
            quit(0);
        }
        throw e;
    }

    var mem = new Uint8Array(ins.exports.mem.buffer);

    // Init above 4GB
    doit(mem, 0x1_0000_1000, 1, S.length-1);

    // Init above 4GB with OOM
    assertErrorMessage(() => ins.exports.f(0x1_0000_ff80n, 0256),
                       WebAssembly.RuntimeError,
                       /out of bounds/);

    // Init across 4GB
    doit(mem, 0xffff_ff80, 3200);
}

function doit(mem, addr, offs, n) {
    ins.exports.f(BigInt(addr), offs, n);
    for (let i=0; i < n; i++) {
        assertEq(mem[addr+i], S.charCodeAt(offs+i));
    }
}


Messung V0.5 in Prozent
C=86 H=95 G=90

¤ Dauer der Verarbeitung: 0.16 Sekunden  (vorverarbeitet am  2026-06-05) ¤

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