WebAssembly store 2026-11-05
A WebAssembly store is the abstract runtime state containing allocated entities such as function, memory, table and global instances. A WebAssembly module instance refers to these entities through WebAssembly abstract addresses. A store memory address selects a memory instance; it is distinct from a byte offset within WebAssembly linear memory.[ref]
WebAssembly Core Specification by the W3C WebAssembly Community Group. Execution, Runtime Structure: Store, Addresses and Module Instances
For an original toy model, let the store contain two memory instances at abstract addresses 0 and 1. Module instances A and B both use local memory index 0, but A maps it to address 0 and B maps it to address 1. A third instance C imports the first memory and maps its own local index 0 to address 0.
Initially, let byte offset 0 in both memories contain zero. Writing 17 through A changes the first memory. Reading offset 0 through B gives zero, while reading it through C gives 17. There are three distinct coordinates: the module-local index, the store address selecting a memory and the offset selecting a byte inside it. Equal local index numbers do not establish sharing.
These invented addresses illustrate the semantics; they are not exposed machine addresses measured from an engine. The WebAssembly store also is not one linear memory or a persistent file store. The abstract model records allocations, while implementations may reclaim unreachable entities when doing so is not semantically observable.[ref]
WebAssembly Core Specification by the W3C WebAssembly Community Group. Runtime Structure: Store note on garbage collection/reference counting; Addresses