jvff opened issue #9169:
Feature
WasmParams
currently supports tuples with up to 16 elements. However,wit-bindgen
may generate imports for functions with up to 17 parameters, in scenarios where there are 16 flat types used for parameters plus an extra pointer for the return heap area. This is (AFAICT) according to the Canonical ABI.Benefit
This would allow using proper typing when exporting functions to Wasm modules following the WIT interface.
Implementation
I tested adding another line here:
https://github.com/bytecodealliance/wasmtime/blob/main/crates/wasmtime/src/runtime/func.rs#L356
and it seemed to work for my use case. I'm not sure if there are tests that need to be updated or if there's a better approach before opening a PR.
Alternatives
I think this could be worked around by not using typed parameters.
alexcrichton commented on issue #9169:
Makes sense to me to add, feel free to send a PR!
alexcrichton closed issue #9169:
Feature
WasmParams
currently supports tuples with up to 16 elements. However,wit-bindgen
may generate imports for functions with up to 17 parameters, in scenarios where there are 16 flat types used for parameters plus an extra pointer for the return heap area. This is (AFAICT) according to the Canonical ABI.Benefit
This would allow using proper typing when exporting functions to Wasm modules following the WIT interface.
Implementation
I tested adding another line here:
https://github.com/bytecodealliance/wasmtime/blob/main/crates/wasmtime/src/runtime/func.rs#L356
and it seemed to work for my use case. I'm not sure if there are tests that need to be updated or if there's a better approach before opening a PR.
Alternatives
I think this could be worked around by not using typed parameters.
Last updated: Nov 22 2024 at 16:03 UTC