Add C API module_instantiate function

This commit is contained in:
Brandon Fish
2019-02-20 23:08:23 -06:00
parent c3065a3869
commit ac57a1bc71
4 changed files with 118 additions and 0 deletions

View File

@ -345,6 +345,17 @@ wasmer_result_t wasmer_memory_new(wasmer_memory_t **memory, wasmer_limits_t limi
*/
void wasmer_module_destroy(wasmer_module_t *module);
/**
* Creates a new Instance from the given module and imports.
* Returns `wasmer_result_t::WASMER_OK` upon success.
* Returns `wasmer_result_t::WASMER_ERROR` upon failure. Use `wasmer_last_error_length`
* and `wasmer_last_error_message` to get an error message.
*/
wasmer_result_t wasmer_module_instantiate(wasmer_module_t *module,
wasmer_instance_t **instance,
wasmer_import_t *imports,
int imports_len);
/**
* Frees memory for the given Table
*/