v133 · webassembly

WebAssembly Memory64

The memory64 proposal adds support for linear WebAssembly memories with size larger than 2^32 bits. It provides no new instructions, but instead extends the existing instructions to allow 64-bit indexes for memories and tables.

concepts

  1. Wasm Memory64

    WebAssembly 64-bit memories. Required for large-data ports (databases, video pipelines) that bumped against the 4GB ceiling.

  2. Large buffer allocation

    Allocate a 5 GiB WebAssembly.Memory with index: "i64" — the use case (ML, image, in-browser DB) that motivated the proposal.

  3. i64 pointer toolbox

    Decode BigInt pointers, check Number safety, compute MiB/GiB offsets — the glue-code patterns memory64 forces on every JS ↔ Wasm boundary.

  4. Address space explorer

    Visualise the gap between the 32-bit (4 GB) ceiling and 64-bit Memory64 space, allocate real WebAssembly.Memory instances with index: "i64", and do BigInt pointer arithmetic that overflows Number.MAX_SAFE_INTEGER.

why it shipped

This feature allows WebAssembly applications to address and use more than 4GB of memory if the system allows for it (64-bit architecture and sufficient available memory).

references