Stream: general

Topic: Sharing memory between transient instances


view this post on Zulip Ancorehraq sis (Dec 30 2022 at 07:09):

I'm using Wasm as a JIT runtime by emitting a module when a hot loop is detected. I want to have multiple instances in the trace cache and I want to be able to evict them. How do I represent this in Wasmtime?

I understand cleaning up instances means one store and module per instance. How do I share a memory between them? Is it safe to have a MemoryCreator that dispenses LinearMemories pointing to the same buffer? Is there a way to coordinate growth between instances?

view this post on Zulip fitzgen (he/him) (Jan 03 2023 at 17:42):

Is it safe to have a MemoryCreator that dispenses LinearMemories pointing to the same buffer?

Instead you would want to have the modules take memory imports and then create a wasmtime::Memory and instantiate multiple instances with the same memory argument.


Last updated: Dec 23 2024 at 12:05 UTC