Struct wasmtime_wmemcheck::Wmemcheck
source · pub struct Wmemcheck {
pub stack_pointer: usize,
pub flag: bool,
/* private fields */
}
Expand description
Memory checker for wasm guest.
Fields§
§stack_pointer: usize
§flag: bool
Implementations§
source§impl Wmemcheck
impl Wmemcheck
sourcepub fn malloc(&mut self, addr: usize, len: usize) -> Result<(), AccessError>
pub fn malloc(&mut self, addr: usize, len: usize) -> Result<(), AccessError>
Updates memory checker memory state metadata when malloc is called.
sourcepub fn read(&mut self, addr: usize, len: usize) -> Result<(), AccessError>
pub fn read(&mut self, addr: usize, len: usize) -> Result<(), AccessError>
Updates memory checker memory state metadata when a load occurs.
sourcepub fn write(&mut self, addr: usize, len: usize) -> Result<(), AccessError>
pub fn write(&mut self, addr: usize, len: usize) -> Result<(), AccessError>
Updates memory checker memory state metadata when a store occurs.
sourcepub fn free(&mut self, addr: usize) -> Result<(), AccessError>
pub fn free(&mut self, addr: usize) -> Result<(), AccessError>
Updates memory checker memory state metadata when free is called.
sourcepub fn update_stack_pointer(&mut self, new_sp: usize) -> Result<(), AccessError>
pub fn update_stack_pointer(&mut self, new_sp: usize) -> Result<(), AccessError>
Updates memory checker metadata when stack pointer is updated.
sourcepub fn memcheck_on(&mut self)
pub fn memcheck_on(&mut self)
Turns memory checking on.
sourcepub fn memcheck_off(&mut self)
pub fn memcheck_off(&mut self)
Turns memory checking off.
sourcepub fn set_stack_size(&mut self, stack_size: usize)
pub fn set_stack_size(&mut self, stack_size: usize)
Initializes stack and stack pointer in memory checker metadata.
sourcepub fn update_mem_size(&mut self, num_bytes: usize)
pub fn update_mem_size(&mut self, num_bytes: usize)
Updates memory checker metadata size when memory.grow is called.
Auto Trait Implementations§
impl Freeze for Wmemcheck
impl RefUnwindSafe for Wmemcheck
impl Send for Wmemcheck
impl Sync for Wmemcheck
impl Unpin for Wmemcheck
impl UnwindSafe for Wmemcheck
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more