alexcrichton edited issue #5641:
Wasmtime provides
WasmStr
andWasmList<T>
, which implLift
, 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.
alexcrichton labeled issue #5641:
Wasmtime provides
WasmStr
andWasmList<T>
, which implLift
, 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: Dec 23 2024 at 12:05 UTC