Skip to main content

shared-memory

Shared memory bindings for WASM modules Enables memory sharing between different WASM module instances

// @ts-ignore
@external("shared_memory", "share_memory")
export declare function shareMemory(wasmAddr: u64, size: u32): i32;


// @ts-ignore
@external("shared_memory", "copy_shared_memory")
export declare function copySharedMemory(fromRef: u64, toWasmAddr: u64, offset: u32, size: u32): i32;


// @ts-ignore
@external("shared_memory", "get_shared_memory_len")
export declare function getSharedMemoryLen(sharedAddr: u64): u32;


// @ts-ignore
@external("shared_memory", "remove_memory_sharing")
export declare function removeMemorySharing(sharedAddr: u64): i32;