Memory
data class Memory
Fields
Name | Description |
---|---|
val id: Memory
|
|
val memoryType: MemoryType
|
Constructors
<init>
constructor(id: Memory, memoryType: MemoryType)
Represents a memory instance in a WasmModule.
From the docs:
The mems
component of a module defines a vector of linear memories (or memories for short) as
described by their memory type:
mem ::=
A memory is a vector of raw uninterpreted bytes. The min
size in the limits of the memory type
specifies the initial size of that memory, while its max
, if present, restricts the size to
which it can grow later. Both are in units of page size.
Memories can be initialized through data segments.
Memories are referenced through memory indices, starting with the smallest index not referencing
a memory import. Most constructs implicitly reference memory index 0
.
Note: In the current version of WebAssembly, at most one memory may be defined or imported in
a single module, and all constructs implicitly reference this memory 0
. This restriction may
be lifted in future versions.
Parameters
Name | Description |
---|---|
id: Memory
|
|
memoryType: MemoryType
|
Represents a memory instance in a WasmModule.
From the docs:
The
mems
component of a module defines a vector of linear memories (or memories for short) as described by their memory type:A memory is a vector of raw uninterpreted bytes. The
min
size in the limits of the memory type specifies the initial size of that memory, while itsmax
, if present, restricts the size to which it can grow later. Both are in units of page size.Memories can be initialized through data segments.
Memories are referenced through memory indices, starting with the smallest index not referencing a memory import. Most constructs implicitly reference memory index
0
.Note: In the current version of WebAssembly, at most one memory may be defined or imported in a single module, and all constructs implicitly reference this memory
0
. This restriction may be lifted in future versions.