[][src]Function wasi_binio_wasm::wasm_prepare_buffer

pub fn wasm_prepare_buffer(size: i32) -> i64

Allocate buffer from wasm linear memory in order to let host to deserialize arguments into

Example

We have to have prepare_buffer function here under [no_mangle] because the binio-host will look for this function from the wasm exports. the purpose of this function is to allocate memory for function args or result the return i64 actually contains two i32. One for buffer pointer another for buffer length

#[no_mangle]
fn prepare_buffer(buffer_size: i32)->i64 {
   wasi_binio_wasm::wasm_prepare_buffer(buffer_size)
}