Stream: wasmtime

Topic: Limiting linear memory use


view this post on Zulip mk89 (Mar 10 2021 at 18:30):

Hi all,

I'm using Wasmtime with the C API and need to limit the memory use of my wasm instances.
My understanding is that it's possible to do so by creating a Memory object whose MemoryType has a Limit that defines a maximum, and this maximum limits the memory in 64KiB blocks.

Now I know how to create this standalone memory, but how do I make my wasm instance to use this memory instead of the one that is imported when the module is loaded? Should I use wasm_memory_as_extern()?

Thank you!


Last updated: Nov 22 2024 at 16:03 UTC