mirror of
https://github.com/fluencelabs/wasmer
synced 2025-06-17 10:51:21 +00:00
Add memory data function
This commit is contained in:
@ -439,6 +439,14 @@ pub extern "C" fn wasmer_instance_context_memory(
|
||||
memory as *const Memory as *const wasmer_memory_t
|
||||
}
|
||||
|
||||
#[allow(clippy::cast_ptr_alignment)]
|
||||
#[no_mangle]
|
||||
pub extern "C" fn wasmer_memory_data(mem: *mut wasmer_memory_t) -> *mut uint8_t {
|
||||
let memory = mem as *mut Memory;
|
||||
use std::cell::Cell;
|
||||
unsafe { ((*memory).view::<u8>()[..]).as_ptr() as *mut Cell<u8> as *mut u8 }
|
||||
}
|
||||
|
||||
#[allow(clippy::cast_ptr_alignment)]
|
||||
#[no_mangle]
|
||||
pub extern "C" fn wasmer_memory_data_length(mem: *mut wasmer_memory_t) -> uint32_t {
|
||||
|
Reference in New Issue
Block a user