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

Function call_v_r

example/hostref.c:48–59  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

46
47
48own wasm_ref_t* call_v_r(const wasm_func_t* func) {
49 printf("call_v_r... "); fflush(stdout);
50 wasm_val_t rs[] = { WASM_INIT_VAL };
51 wasm_val_vec_t args = WASM_EMPTY_VEC;
52 wasm_val_vec_t results = WASM_ARRAY_VEC(rs);
53 if (wasm_func_call(func, &args, &results)) {
54 printf("> Error calling function!\n");
55 exit(1);
56 }
57 printf("okay\n");
58 return rs[0].of.ref;
59}
60
61void call_r_v(const wasm_func_t* func, wasm_ref_t* ref) {
62 printf("call_r_v... "); fflush(stdout);

Callers 1

mainFunction · 0.70

Calls 1

wasm_func_callFunction · 0.85

Tested by

no test coverage detected