bytecodealliance / bytecodealliance/wasmtime
component bindgen: use borrowed values in import function parameters
Open
wasm-proposal:component-model
- Dominant language
- Rust
- Stars
- 18.6k
- Forks
- 1.8k
- Avg merge
- 1d 18h
- Merged PRs (30d)
- 126
Description
Wasmtime provides `WasmStr` and `WasmList`, 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.
Contributor guide
Assessment
This issue has not been assessed yet.