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

Method externref

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

Source from the content-addressed store, hash-verified

73inline Val::Val(ExternRef ptr) : Val(std::optional(ptr)) {}
74
75inline std::optional<ExternRef> Val::externref() const {
76 if (val.kind != WASMTIME_EXTERNREF) {
77 std::abort();
78 }
79 if (wasmtime_externref_is_null(&val.of.externref)) {
80 return std::nullopt;
81 }
82 wasmtime_externref_t other;
83 wasmtime_externref_clone(&val.of.externref, &other);
84 return ExternRef(other);
85}
86
87inline Val::Val(std::optional<ExnRef> ptr) : val{} {
88 val.kind = WASMTIME_EXNREF;

Callers 3

mainFunction · 0.45
TESTFunction · 0.45
TESTFunction · 0.45

Calls 3

abortFunction · 0.85
ExternRefClass · 0.70

Tested by 2

TESTFunction · 0.36
TESTFunction · 0.36