ImportedMemory
class ImportedMemory(val moduleName: String = "main", val memoryName: String = "memory", val spec: MemorySpec = MemorySpec.Builder()
.setMaxSize(WASM_MEMORY_32_MAX_PAGES)
.build()) : MemorySource(source)
The memory is imported from the module moduleName, where it is exported as memoryName. The imported memory's limits are defined by the spec.
To import memory from the main module, set moduleName to "main" (this can be used to instantiate the WASI Snapshot Preview 1 module). In WebAssembly files compiled with Emscripten, memory is typically provided by a module named "env".
Constructors
Link copied to clipboard
constructor(moduleName: String = "main", memoryName: String = "memory", spec: MemorySpec = MemorySpec.Builder()
.setMaxSize(WASM_MEMORY_32_MAX_PAGES)
.build())