demo · v133
Wasm Memory64
Construct a real 64-bit-indexed WebAssembly.Memory from JS, then bump it past the old 32-bit-indexed ceiling and read its buffer back. Browsers without memory64 reject the constructor option.
buffer.byteLength
-
addressing
-
checking support...
the code
// Memory64 enabled: pass index: "i64".
const mem = new WebAssembly.Memory({
initial: 2,
maximum: 65536,
index: "i64", // NEW in Chrome 133 - opt-in to 64-bit addressing
});
mem.grow(4);
console.log(mem.buffer.byteLength); // can exceed 4GB
see also
- WebAssembly Memory64 - feature index
- ChromeStatus entry
- memory64 proposal