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

Function call_r_r

example/hostref.cc:69–79  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

67}
68
69auto call_r_r(const wasm::Func* func, const wasm::Ref* ref) -> wasm::own<wasm::Ref> {
70 std::cout << "call_r_r... " << std::flush;
71 auto args = wasm::vec<wasm::Val>::make(wasm::Val::ref(ref ? ref->copy() : wasm::own<wasm::Ref>()));
72 auto results = wasm::vec<wasm::Val>::make_uninitialized(1);
73 if (func->call(args, results)) {
74 std::cout << "> Error calling function!" << std::endl;
75 exit(1);
76 }
77 std::cout << "okay" << std::endl;
78 return results[0].release_ref();
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;

Callers 1

runFunction · 0.70

Calls 3

callMethod · 0.80
release_refMethod · 0.80
copyMethod · 0.45

Tested by

no test coverage detected