pub enum AbstractMemoryLocation {
Location {
offset: i64,
size: ByteSize,
},
Pointer {
offset: i64,
target: Box<AbstractMemoryLocation>,
},
}
Expand description
An abstract memory location is either an offset from the given location, where the actual value can be found,
or an offset to a pointer to another memory location,
where the value can be found by (recursively) following the embedded target
memory location.
The offset and size variables are given in bytes.
Variants§
Location
Fields
A location inside the current memory object.
Pointer
Fields
target: Box<AbstractMemoryLocation>
The memory location inside the target of the pointer that this memory location points to.
A pointer which needs to be followed to get to the actual memory location
Implementations§
source§impl AbstractMemoryLocation
impl AbstractMemoryLocation
sourcepub fn get_parent_location(
&self,
generic_pointer_size: ByteSize
) -> Result<(AbstractMemoryLocation, i64), i64>
pub fn get_parent_location( &self, generic_pointer_size: ByteSize ) -> Result<(AbstractMemoryLocation, i64), i64>
Get the abstract memory location representing the pointer pointing to the memory object
that contains the location represented by self
together with the offset that one has to add to the pointer to get the location of self.
If self
is a location (and not a pointer), return the offset in the location instead.
sourcepub fn add_offset(&mut self, addendum: i64)
pub fn add_offset(&mut self, addendum: i64)
Add an offset to a memory location.
sourcepub fn add_offset_at_root(&mut self, addendum: i64)
pub fn add_offset_at_root(&mut self, addendum: i64)
Add an offset to the root location of the memory location.
sourcepub fn dereference(
&mut self,
new_size: ByteSize,
generic_pointer_size: ByteSize
)
pub fn dereference( &mut self, new_size: ByteSize, generic_pointer_size: ByteSize )
Dereference the pointer that self
is pointing to.
Panics if the old value of self
is not pointer-sized.
sourcepub fn extend(
&mut self,
extension: AbstractMemoryLocation,
generic_pointer_size: ByteSize
)
pub fn extend( &mut self, extension: AbstractMemoryLocation, generic_pointer_size: ByteSize )
Extend the location string by adding further derefence operations to it according to the given extension.
sourcepub fn bytesize(&self) -> ByteSize
pub fn bytesize(&self) -> ByteSize
Get the bytesize of the value represented by the abstract memory location.
sourcepub fn recursion_depth(&self) -> u64
pub fn recursion_depth(&self) -> u64
Get the recursion depth of the abstract memory location, i.e. how many times one has to dereference a pointer until reaching the actual location.
Trait Implementations§
source§impl Clone for AbstractMemoryLocation
impl Clone for AbstractMemoryLocation
source§fn clone(&self) -> AbstractMemoryLocation
fn clone(&self) -> AbstractMemoryLocation
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moresource§impl Debug for AbstractMemoryLocation
impl Debug for AbstractMemoryLocation
source§impl<'de> Deserialize<'de> for AbstractMemoryLocation
impl<'de> Deserialize<'de> for AbstractMemoryLocation
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>,
source§impl Display for AbstractMemoryLocation
impl Display for AbstractMemoryLocation
source§impl Hash for AbstractMemoryLocation
impl Hash for AbstractMemoryLocation
source§impl Ord for AbstractMemoryLocation
impl Ord for AbstractMemoryLocation
source§fn cmp(&self, other: &AbstractMemoryLocation) -> Ordering
fn cmp(&self, other: &AbstractMemoryLocation) -> Ordering
1.21.0 · source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
source§impl PartialEq for AbstractMemoryLocation
impl PartialEq for AbstractMemoryLocation
source§fn eq(&self, other: &AbstractMemoryLocation) -> bool
fn eq(&self, other: &AbstractMemoryLocation) -> bool
self
and other
values to be equal, and is used
by ==
.source§impl PartialOrd for AbstractMemoryLocation
impl PartialOrd for AbstractMemoryLocation
source§fn partial_cmp(&self, other: &AbstractMemoryLocation) -> Option<Ordering>
fn partial_cmp(&self, other: &AbstractMemoryLocation) -> Option<Ordering>
1.0.0 · source§fn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
self
and other
) and is used by the <=
operator. Read moresource§impl Serialize for AbstractMemoryLocation
impl Serialize for AbstractMemoryLocation
impl Eq for AbstractMemoryLocation
impl StructuralEq for AbstractMemoryLocation
impl StructuralPartialEq for AbstractMemoryLocation
Auto Trait Implementations§
impl RefUnwindSafe for AbstractMemoryLocation
impl Send for AbstractMemoryLocation
impl Sync for AbstractMemoryLocation
impl Unpin for AbstractMemoryLocation
impl UnwindSafe for AbstractMemoryLocation
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
§impl<Q, K> Comparable<K> for Q
impl<Q, K> Comparable<K> for Q
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key
and return true
if they are equal.