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 more