polywrap_wasm.memory module

This module contains the create_memory function for creating a shared memory instance for a Wasm module.

polywrap_wasm.memory.create_memory(store: Store, module: bytes) Memory[source]

Create a host allocated shared memory instance for a Wasm module.

Parameters:
  • store (Store) – The Wasm store.

  • module (bytes) – The Wasm module.

Raises:

WasmMemoryError – if the memory import is not found in the Wasm module.

Returns:

The shared memory instance.

Return type:

Memory