pub struct MemoryOffsetChoices(pub u32, pub u32, pub u32);Expand description
This is a tuple (a, b, c) where
-
a / (a+b+c)is the probability of generating a memory offset within0..memory.min_size, i.e. an offset that is definitely in bounds of a non-empty memory. (Note that if a memory is zero-sized, however, no offset will ever be in bounds.) -
b / (a+b+c)is the probability of generating a memory offset withinmemory.min_size..memory.max_size, i.e. an offset that is possibly in bounds if the memory has been grown. -
c / (a+b+c)is the probability of generating a memory offset within the rangememory.max_size.., i.e. an offset that is definitely out of bounds.
At least one of a, b, and c must be non-zero.
If you want to always generate memory offsets that are definitely in bounds
of a non-zero-sized memory, for example, you could return (1, 0, 0).
The default is (90, 9, 1).
Tuple Fields§
§0: u32§1: u32§2: u32Trait Implementations§
source§impl Clone for MemoryOffsetChoices
impl Clone for MemoryOffsetChoices
source§fn clone(&self) -> MemoryOffsetChoices
fn clone(&self) -> MemoryOffsetChoices
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moresource§impl Debug for MemoryOffsetChoices
impl Debug for MemoryOffsetChoices
source§impl Default for MemoryOffsetChoices
impl Default for MemoryOffsetChoices
source§impl<'de> Deserialize<'de> for MemoryOffsetChoices
impl<'de> Deserialize<'de> for MemoryOffsetChoices
source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Auto Trait Implementations§
impl Freeze for MemoryOffsetChoices
impl RefUnwindSafe for MemoryOffsetChoices
impl Send for MemoryOffsetChoices
impl Sync for MemoryOffsetChoices
impl Unpin for MemoryOffsetChoices
impl UnwindSafe for MemoryOffsetChoices
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
source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
clone_to_uninit)