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

This function is required to transform a `wasmer_byte_array` into a
`wasmer_serialized_module_t`. This is the complementary function of
`wasmer_serialized_module_bytes`.
This commit is contained in:
Ivan Enderlin
2019-03-19 10:51:43 +01:00
parent 5e31a1b6d1
commit 46edd20725
4 changed files with 61 additions and 0 deletions

View File

@@ -537,6 +537,16 @@ wasmer_byte_array wasmer_serialized_module_bytes(const wasmer_serialized_module_
*/
void wasmer_serialized_module_destroy(wasmer_serialized_module_t *serialized_module);
/**
* Transform a sequence of bytes into a serialized module.
* The caller owns the object and should call `wasmer_serialized_module_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.
*/
wasmer_result_t wasmer_serialized_module_from_bytes(wasmer_serialized_module_t **serialized_module,
const wasmer_byte_array *serialized_module_bytes);
/**
* Frees memory for the given Table
*/