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

Function call_i_r

example/hostref.cc:93–103  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

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;
95 auto args = wasm::vec<wasm::Val>::make(wasm::Val::i32(i));
96 auto results = wasm::vec<wasm::Val>::make_uninitialized(1);
97 if (func->call(args, results)) {
98 std::cout << "> Error calling function!" << std::endl;
99 exit(1);
100 }
101 std::cout << "okay" << std::endl;
102 return results[0].release_ref();
103}
104
105void check(wasm::own<wasm::Ref> actual, const wasm::Ref* expected) {
106 if (actual.get() != expected &&

Callers 1

runFunction · 0.70

Calls 2

callMethod · 0.80
release_refMethod · 0.80

Tested by

no test coverage detected