Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@bjfish
Created March 5, 2019 04:46
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save bjfish/60d07992e4cc49ec967d921db3dbc4cc to your computer and use it in GitHub Desktop.
Save bjfish/60d07992e4cc49ec967d921db3dbc4cc to your computer and use it in GitHub Desktop.
// Call the exported "hello_wasm" function of our instance
wasmer_value_t params[] = {};
wasmer_value_t result_one;
wasmer_value_t results[] = {result_one};
wasmer_result_t call_result = wasmer_instance_call(instance, "_hello_wasm", params, 0, results, 1);
printf("Call result: %d\n", call_result);
assert(call_result == WASMER_OK);
assert(print_str_called);
// Use *_destroy methods to cleanup as specified in the header documentation
wasmer_import_func_destroy(func);
wasmer_global_destroy(global);
wasmer_memory_destroy(memory);
wasmer_instance_destroy(instance);
return 0;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment