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: u32
Trait 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
)