I want to manually construct CodeMemory
. Right now I am facing difficultly to construct it as it requires MmapVec
. I can't use file based APIs as I have a custom persistence layer which has completely different APIs and need to go at the level of CodeMemory
and MmapVec
. I checked out wasmtime_runtime
but they are completely different types not expected by CodeMemory
. Any help would be highly appreciated, thanks
The wasmtime_runtime crate has been merged into the main wasmtime crate a while back. MmapVec is not publicly accessible.
@bjorn3 thanks for the response. So what's the way to go if I want to work with CodeMemory APIs ?
I'm surprised CodeMemory is public at all. I can't find any way it would be useful at all.
@bjorn3 yeah, I also thought so. Any specific reason not to expose such APIs ?
You probably want to use Module::serialize
+ Module::deserialize
if you handle caching yourself without going through files.
Module::deserialize_file
is slightly more efficient as it avoids writing the module to a memfd, but if you are avoiding real files, the compiled module will eventually have to end up in a memfd anyway for wasmtime to be able to mmap it.
@bjorn3 thanks for the explanation. This makes sense. Let me try to look into the Module APIs only. Thanks again.
Till Schneidereit has marked this topic as resolved.
Last updated: Nov 22 2024 at 16:03 UTC