pchickey opened issue #5050:
Feature
Host component import function parameters should take borrowed values.
Presently, the arguments to a host component import function (as provided to
wasmtime::component::LinkerInstance::func_wrap) have to implementIntoComponentFunc, whose argument list is required to implLift.Liftdoes not allow borrowed values. So, these import functions are passedStringwhen it would be better for them to accept&str.Benefit
Passing in a borrowed value will reduce the number of copies required to output lists. The implementation of a synchronous
fd_writewould benefit from this optimization.
pchickey labeled issue #5050:
Feature
Host component import function parameters should take borrowed values.
Presently, the arguments to a host component import function (as provided to
wasmtime::component::LinkerInstance::func_wrap) have to implementIntoComponentFunc, whose argument list is required to implLift.Liftdoes not allow borrowed values. So, these import functions are passedStringwhen it would be better for them to accept&str.Benefit
Passing in a borrowed value will reduce the number of copies required to output lists. The implementation of a synchronous
fd_writewould benefit from this optimization.
pchickey edited issue #5050:
Feature
Host component import function parameters should take borrowed values.
Presently, the arguments to a host component import function (as provided to
wasmtime::component::LinkerInstance::func_wrap) have to implementIntoComponentFunc, whose argument list is required to implLift.Liftdoes not allow borrowed values. So, these import functions are passedStringorVec<u8>when it would be better for them to accept&stror&[u8]. A borrowed value would be able to point to memory in a guest linear memory, whereas an owned value requires a copy out of linear memory.Benefit
Passing in a borrowed value will reduce the number of copies required to output lists. The implementation of a synchronous
fd_writewould benefit from this optimization.
pchickey edited issue #5050:
Feature
Host component import function parameters should take borrowed values.
Presently, the arguments to a host component import function (as provided to
wasmtime::component::LinkerInstance::func_wrap) have to implementIntoComponentFunc, whose argument list is required to implLift.Liftdoes not allow borrowed values. So, these import functions are passedStringorVec<u8>when it would be better for them to accept&stror&[u8].Benefit
Passing in a borrowed value will reduce the number of copies required to output lists. A borrowed value would be able to point to memory in a guest linear memory, whereas an owned value requires a copy out of linear memory.
The implementation of a synchronous
fd_writewould benefit from this optimization.
pchickey commented on issue #5050:
I got this wrong. Borrowed values are available in parameters to import funcs via
WasmStrandWasmList. Wasmtime has what we need, so I'll file an issue on wit-bindgen to use them.
pchickey closed issue #5050:
Feature
Host component import function parameters should take borrowed values.
Presently, the arguments to a host component import function (as provided to
wasmtime::component::LinkerInstance::func_wrap) have to implementIntoComponentFunc, whose argument list is required to implLift.Liftdoes not allow borrowed values. So, these import functions are passedStringorVec<u8>when it would be better for them to accept&stror&[u8].Benefit
Passing in a borrowed value will reduce the number of copies required to output lists. A borrowed value would be able to point to memory in a guest linear memory, whereas an owned value requires a copy out of linear memory.
The implementation of a synchronous
fd_writewould benefit from this optimization.
Last updated: Dec 06 2025 at 06:05 UTC