feat(runtime-c-api) Add the wasmer_module_serialization_destroy function.

This commit is contained in:
Ivan Enderlin
2019-03-18 16:05:04 +01:00
parent aac5c88b58
commit 6605a02316
4 changed files with 21 additions and 11 deletions

View File

@ -405,10 +405,11 @@ wasmer_result_t wasmer_module_instantiate(const wasmer_module_t *module,
wasmer_import_t *imports,
int imports_len);
/// Frees memory for the given serialized Module.
void wasmer_module_serialization_destroy(wasmer_byte_array *serialized_module);
/// Serialize the given Module.
/// It's up to the caller to free the memory of the
/// `serialized_module` byte array (both the `bytes` field and the
/// structure).
/// The caller owns the object and should call `wasmer_memory_serialization_destroy` to free it.
/// 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.