alexcrichton opened PR #1654 from wasmtime-func-table-apis
to master
:
This commit adds a suite of
wasmtime_funcref_table_*
APIs which mirror
the standard APIs but have a few differences:
More errors are returned. For example error messages are communicated
throughwasmtime_error_t
and out-of-bounds vs load of null can be
differentiated in theget
API.APIs take
wasm_func_t
instead ofwasm_ref_t
. Given the recent
decision to remove subtyping from the anyref proposal it's not clear
how the C API for tables will be affected, so for now these APIs are
all specialized to only funcref tables.Growth now allows access to the previous size of the table, if
desired, which mirrors thetable.grow
instruction.This was originally motivated by bytecodealliance/wasmtime-go#5 where
the current APIs we have for working with tables don't quite work. We
don't have a great way to take an anyref constructed from aFunc
and
get theFunc
back out, so for now this sidesteps those concerns while
we sort out the anyref story.It's intended that once the anyref story has settled and the official C
API has updated we'll likely delete these wasmtime-specific APIs or
implement them as trivial wrappers around the official ones.
alexcrichton requested yurydelendik for a review on PR #1654.
sunfishcode merged PR #1654.
Last updated: Dec 23 2024 at 12:05 UTC