Module ABI
This section describes some low-level details of ABI used for module linking and passing values in module-module and module-host schemes.
The best way to see ABI functions is to use the following command:
sh
sh
All these functions are generated by the SDK and normally a developer shouldn't care about them.
Let's consider all these functions:
allocate
rust
rust
Allocate memory enough to place elem_count objects of type elem_ty, returns a pointer to allocated memory region
release_objects
rust
rust
Removes objects that were saved by generated by the #[marine] macro code to prevent their deletion before parameters passing ends. Usually called by the IT side at the end of passing a function result.
Next four functions are intended to pass results from called functions. They are temporary solution and intended to overcome missing multi-value feature in IT, will be removed in the future with the multi-value passing scheme.
get_result_size
rust
rust
Returns a size of a result to the IT operand stack.
get_result_ptr
rust
rust
Returns a pointer to a result to the IT operand stack.
set_result_size
rust
rust
Set a size of a result to the given value.
set_result_ptr
rust
rust
Set a pointer of a result to the given value.