MCPcopy Create free account
hub / github.com/WebAssembly/wasm-c-api / call_ir_v

Function call_ir_v

example/hostref.cc:81–91  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

79}
80
81void call_ir_v(const wasm::Func* func, int32_t i, const wasm::Ref* ref) {
82 std::cout << "call_ir_v... " << std::flush;
83 auto args = wasm::vec<wasm::Val>::make(
84 wasm::Val::i32(i), wasm::Val::ref(ref ? ref->copy() : wasm::own<wasm::Ref>()));
85 auto results = wasm::vec<wasm::Val>::make();
86 if (func->call(args, results)) {
87 std::cout << "> Error calling function!" << std::endl;
88 exit(1);
89 }
90 std::cout << "okay" << std::endl;
91}
92
93auto call_i_r(const wasm::Func* func, int32_t i) -> wasm::own<wasm::Ref> {
94 std::cout << "call_i_r... " << std::flush;

Callers 1

runFunction · 0.70

Calls 2

callMethod · 0.80
copyMethod · 0.45

Tested by

no test coverage detected