Stream: git-wasmtime

Topic: wasmtime / issue #5641 gen-host-wasmtime-rust: use borrow...


view this post on Zulip Wasmtime GitHub notifications bot (Jan 26 2023 at 15:32):

pchickey opened issue #5641:

Wasmtime provides WasmStr and WasmList<T>, which impl Lift, which make it possible for import function parameters to borrow strings and (primitive) lists from the canonical ABI caller's linear memory, rather than pass the import function an owned copy.

Presently, import bindings will always have Wasmtime create an owned copy, and pass it directly to the trait method.

It would be better if import bindings have Wasmtime pass the WasmStr/WasmList version of these args, and transform those to the &str/&[_] forms, and pass those borrowed values to the trait method.

view this post on Zulip Wasmtime GitHub notifications bot (Jan 26 2023 at 15:32):

alexcrichton edited issue #5641:

Wasmtime provides WasmStr and WasmList<T>, which impl Lift, which make it possible for import function parameters to borrow strings and (primitive) lists from the canonical ABI caller's linear memory, rather than pass the import function an owned copy.

Presently, import bindings will always have Wasmtime create an owned copy, and pass it directly to the trait method.

It would be better if import bindings have Wasmtime pass the WasmStr/WasmList version of these args, and transform those to the &str/&[_] forms, and pass those borrowed values to the trait method.


Last updated: Nov 22 2024 at 17:03 UTC