Created
March 5, 2019 04:49
-
-
Save bjfish/7eb5b1774c0be8515760dd9c8b0298bd to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 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