mirror of
https://github.com/fluencelabs/wasmer
synced 2025-07-01 01:21:32 +00:00
feat(runtime-core) Allow dynamic signature for polymorphic host functions.
This patch adds a new field in `Func`: `signature`. It contains the signature of the host function. For non-polymorphic host functions, the signature is computed from the `Args` and `Rets` implementation parameters at compile-time. For polymorphic host functions though, to be fully dynamic, the signature given to `new_polymorphic` is used in `Func` as the correct signature.
This commit is contained in:
@ -154,7 +154,7 @@ fn imported_functions_forms(test: &dyn Fn(&Instance)) {
|
||||
Ok(n + 1)
|
||||
}),
|
||||
|
||||
"callback_closure_polymorphic" => Func::<i32, i32, _>::new_polymorphic(
|
||||
"callback_closure_polymorphic" => Func::new_polymorphic(
|
||||
Arc::new(FuncSig::new(vec![Type::I32], vec![Type::I32])),
|
||||
|_, params| -> Vec<Value> {
|
||||
match params[0] {
|
||||
|
Reference in New Issue
Block a user