Stream: git-wasmtime

Topic: wasmtime / issue #10245 Enable deserializing code owned b...


view this post on Zulip Wasmtime GitHub notifications bot (Feb 19 2025 at 20:34):

alexcrichton opened issue #10245:

Currently in Wasmtime we have Module::deserialize and Module::deserialize_file. Given these APIs though it has the fundamental requirements that deserialize will copy the bytes into Wasmtime (e.g. some new map) and deserialize_file requires std 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 to MmapVec 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.

view this post on Zulip Wasmtime GitHub notifications bot (Feb 27 2025 at 18:00):

alexcrichton added the enhancement label to Issue #10245.

view this post on Zulip Wasmtime GitHub notifications bot (Feb 27 2025 at 18:00):

alexcrichton added the wasmtime:api label to Issue #10245.


Last updated: Feb 28 2025 at 02:27 UTC