alexcrichton opened issue #10245:
Currently in Wasmtime we have
Module::deserialize
andModule::deserialize_file
. Given these APIs though it has the fundamental requirements thatdeserialize
will copy the bytes into Wasmtime (e.g. some new map) anddeserialize_file
requiresstd
support. That means that these APIs are not compatible with a#![no_std]
situation which already has bytes loaded elsewhere in memory. There's no need to mutate the bytes so we just need a read-only view of the bytes.One possibility would be to add a
deserialize_raw
API which takes*const [u8]
or similar. That would mean that we're not responsible for owning the memory at all and the embedder is responsible for ensuring it stays alive long enough as well as is able to update page permissions (which isn't applicable for Pulley but may be applicable for other platforms). This might be done by copying this API to have raw pointers and then adding a new variant toMmapVec
which represents a non-owned pointer.The end goal is that Wasmtime should be able to load bytes from an external source without needing to copy out of that source in a
no_std
context.
alexcrichton added the enhancement label to Issue #10245.
alexcrichton added the wasmtime:api label to Issue #10245.
Last updated: Feb 28 2025 at 02:27 UTC