Struct vstd::simple_pptr::PointsTo
source · pub struct PointsTo<V> { /* private fields */ }
Expand description
A tracked
ghost object that gives the user permission to dereference a pointer
for reading or writing, or to free the memory at that pointer.
The meaning of a PointsTo
object is given by the data in its
View
object, PointsToData
.
See the PPtr
documentation for more details.
Implementations§
source§impl<V> PointsTo<V>
impl<V> PointsTo<V>
sourcepub closed spec fn mem_contents(&self) -> MemContents<V>
pub closed spec fn mem_contents(&self) -> MemContents<V>
sourcepub proof fn is_nonnull(tracked &self)
pub proof fn is_nonnull(tracked &self)
self.addr() != 0,
Guarantee that the PointsTo
points to a non-null address.
sourcepub proof fn leak_contents(tracked &mut self)
pub proof fn leak_contents(tracked &mut self)
self.pptr() == old(self).pptr(),
self.is_uninit(),
“Forgets” about the value stored behind the pointer.
Updates the PointsTo
value to MemContents::Uninit
.
Note that this is a proof
function, i.e., it is operationally a no-op in executable code.
sourcepub proof fn is_disjoint<S>(&mut self, other: &PointsTo<S>)
pub proof fn is_disjoint<S>(&mut self, other: &PointsTo<S>)
*old(self) == *self,
self.addr() + size_of::<V>() <= other.addr()
|| other.addr() + size_of::<S>() <= self.addr(),
Guarantees that two distinct PointsTo<V>
objects point to disjoint ranges of memory.
If both S and V are non-zero-sized, then this also implies the pointers
have distinct addresses.
sourcepub proof fn is_distinct<S>(&mut self, other: &PointsTo<S>)
pub proof fn is_distinct<S>(&mut self, other: &PointsTo<S>)
size_of::<V>() != 0,
size_of::<S>() != 0,
ensures*old(self) == *self,
self.addr() != other.addr(),
Guarantees that two distinct, non-ZST PointsTo<V>
objects point to different
addresses. This is a corollary of PointsTo::is_disjoint
.