wasm_runtime_shared_heap_malloc

Function wasm_runtime_shared_heap_malloc 

Source
pub unsafe extern "C" fn wasm_runtime_shared_heap_malloc(
    module_inst: wasm_module_inst_t,
    size: u64,
    p_native_addr: *mut *mut c_void,
) -> u64
Expand description

Allocate memory from a shared heap

@param module_inst the module instance @param size required memory size @param p_native_addr native address of allocated memory

@return return the allocated memory address, which reuses part of the wasm address space and is in the range of [UINT32 - shared_heap_size + 1, UINT32] (when the wasm memory is 32-bit) or [UINT64 - shared_heap_size + 1, UINT64] (when the wasm memory is 64-bit). Note that it is not an absolute address. Return non-zero if success, zero if failed.