Stream: git-wasmtime

Topic: wasmtime / issue #4144 get arity of function in c api


view this post on Zulip Wasmtime GitHub notifications bot (May 12 2022 at 10:39):

pannous opened issue #4144:

How to get the arity of a wasmtime function in the c api?

 int nresults = wasm_func_result_arity(wasmFunc);

works for wasm_func_t but doesn't work for wasmtime_func_t (EXC_BAD_ACCESS)

view this post on Zulip Wasmtime GitHub notifications bot (May 12 2022 at 11:24):

bjorn3 commented on issue #4144:

It doesn't look like there is a function for that in the wasmtime c api. That wasm_func_result_arity doesn't work for wasmtime_func_t is expected as you are mixing two different api's in that case. You need to use either the wasm_* api's or the wasmtime_* api's, you can't use both at the same time.

view this post on Zulip Wasmtime GitHub notifications bot (May 12 2022 at 15:04):

alexcrichton commented on issue #4144:

For this you'll need to use wasmtime_func_type followed by wasm_functype_results which you can get the size from.

view this post on Zulip Wasmtime GitHub notifications bot (May 12 2022 at 15:04):

alexcrichton closed issue #4144:

How to get the arity of a wasmtime function in the c api?

 int nresults = wasm_func_result_arity(wasmFunc);

works for wasm_func_t but doesn't work for wasmtime_func_t (EXC_BAD_ACCESS)

view this post on Zulip Wasmtime GitHub notifications bot (May 12 2022 at 23:05):

pannous commented on issue #4144:

that worked, thanks a lot!


Last updated: Nov 22 2024 at 17:03 UTC