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

Function call_r_v

example/hostref.cc:46–55  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

44
45
46void call_r_v(const wasm::Func* func, const wasm::Ref* ref) {
47 std::cout << "call_r_v... " << std::flush;
48 auto args = wasm::vec<wasm::Val>::make(wasm::Val::ref(ref ? ref->copy() : wasm::own<wasm::Ref>()));
49 auto results = wasm::vec<wasm::Val>::make();
50 if (func->call(args, results)) {
51 std::cout << "> Error calling function!" << std::endl;
52 exit(1);
53 }
54 std::cout << "okay" << std::endl;
55}
56
57auto call_v_r(const wasm::Func* func) -> wasm::own<wasm::Ref> {
58 std::cout << "call_v_r... " << std::flush;

Callers 1

runFunction · 0.70

Calls 2

callMethod · 0.80
copyMethod · 0.45

Tested by

no test coverage detected