Memory64
Memory64 allows memories and tables to use i64 indices instead of i32, expanding the addressable space from 4 GiB to 16 EiB.
(module ;; 64-bit addressed memory (1 page minimum) (memory $mem i64 1)
(func (export "load64") (param $addr i64) (result i32) (i32.load (local.get $addr)))
(func (export "size") (result i64) (memory.size)))When used with an i64-addressed memory:
- Memory instructions (
i32.load,i64.store, etc.) accepti64addresses memory.sizeandmemory.growreturn and accepti64values- Bulk memory operations (
memory.copy,memory.fill,memory.init) usei64for addresses and lengths - Tables also support
i64indexing:(table $tbl i64 10 funcref)
Instruction Reference
Section titled “Instruction Reference”- Memory Instructions —
i32.load,i32.store,memory.size,memory.grow,memory.copy,memory.fill - Table Instructions —
table.get,table.set,table.size,table.grow