MCPcopy Create free account
hub / github.com/bytecodealliance/wasmtime / funcref

Method funcref

crates/c-api/include/wasmtime/val.hh:27–35  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

25inline Val::Val(Func func) : Val(std::optional(func)) {}
26
27inline std::optional<Func> Val::funcref() const {
28 if (val.kind != WASMTIME_FUNCREF) {
29 std::abort();
30 }
31 if (val.of.funcref.store_id == 0) {
32 return std::nullopt;
33 }
34 return Func(val.of.funcref);
35}
36
37#ifdef WASMTIME_FEATURE_GC
38

Callers 3

TESTFunction · 0.45
TESTFunction · 0.45
TESTFunction · 0.45

Calls 2

abortFunction · 0.85
FuncClass · 0.70

Tested by 3

TESTFunction · 0.36
TESTFunction · 0.36
TESTFunction · 0.36