Struct ConcurrentMemory
pub struct ConcurrentMemory<M>where
M: Memory + Obj,{
memory: M,
accesses: List<Access>,
}Fields§
§memory: M§accesses: List<Access>Implementations§
§impl<M> ConcurrentMemory<M>where
M: Memory + Obj,
impl<M> ConcurrentMemory<M>where
M: Memory + Obj,
pub fn new(params: <M as Memory>::Params) -> ConcurrentMemory<M>
pub fn allocate(
&mut self,
kind: AllocationKind,
size: Size,
align: Align,
) -> NdResult<ThinPointer<<M as Memory>::Provenance>, TerminationInfo>
pub fn allocate( &mut self, kind: AllocationKind, size: Size, align: Align, ) -> NdResult<ThinPointer<<M as Memory>::Provenance>, TerminationInfo>
Create a new allocation.
The initial contents of the allocation are AbstractByte::Uninit.
pub fn deallocate(
&mut self,
ptr: ThinPointer<<M as Memory>::Provenance>,
kind: AllocationKind,
size: Size,
align: Align,
) -> Result<(), TerminationInfo>
pub fn deallocate( &mut self, ptr: ThinPointer<<M as Memory>::Provenance>, kind: AllocationKind, size: Size, align: Align, ) -> Result<(), TerminationInfo>
Remove an allocation.
pub fn store(
&mut self,
ptr: ThinPointer<<M as Memory>::Provenance>,
bytes: List<AbstractByte<<M as Memory>::Provenance>>,
align: Align,
atomicity: Atomicity,
) -> Result<(), TerminationInfo>
pub fn store( &mut self, ptr: ThinPointer<<M as Memory>::Provenance>, bytes: List<AbstractByte<<M as Memory>::Provenance>>, align: Align, atomicity: Atomicity, ) -> Result<(), TerminationInfo>
Write some bytes to memory and check for data races.
pub fn load(
&mut self,
ptr: ThinPointer<<M as Memory>::Provenance>,
len: Size,
align: Align,
atomicity: Atomicity,
) -> Result<List<AbstractByte<<M as Memory>::Provenance>>, TerminationInfo>
pub fn load( &mut self, ptr: ThinPointer<<M as Memory>::Provenance>, len: Size, align: Align, atomicity: Atomicity, ) -> Result<List<AbstractByte<<M as Memory>::Provenance>>, TerminationInfo>
Read some bytes from memory and check for data races.
pub fn dereferenceable(
&self,
ptr: ThinPointer<<M as Memory>::Provenance>,
len: Size,
) -> Result<(), TerminationInfo>
pub fn dereferenceable( &self, ptr: ThinPointer<<M as Memory>::Provenance>, len: Size, ) -> Result<(), TerminationInfo>
Test whether the given pointer is dereferenceable for the given size. Raises UB if that is not the case.
pub fn signed_dereferenceable(
&self,
ptr: ThinPointer<<M as Memory>::Provenance>,
len: Int,
) -> Result<(), TerminationInfo>
pub fn signed_dereferenceable( &self, ptr: ThinPointer<<M as Memory>::Provenance>, len: Int, ) -> Result<(), TerminationInfo>
A derived form of dereferenceable that works with a signed notion on “length”.
pub fn retag_ptr(
&mut self,
frame_extra: &mut <M as Memory>::FrameExtra,
ptr: Pointer<<M as Memory>::Provenance>,
ptr_type: PtrType,
fn_entry: bool,
fn_implicit_writes: bool,
vtable_lookup: impl Fn(ThinPointer<<M as Memory>::Provenance>) -> VTable + 'static,
) -> Result<Pointer<<M as Memory>::Provenance>, TerminationInfo>
pub fn retag_ptr( &mut self, frame_extra: &mut <M as Memory>::FrameExtra, ptr: Pointer<<M as Memory>::Provenance>, ptr_type: PtrType, fn_entry: bool, fn_implicit_writes: bool, vtable_lookup: impl Fn(ThinPointer<<M as Memory>::Provenance>) -> VTable + 'static, ) -> Result<Pointer<<M as Memory>::Provenance>, TerminationInfo>
Return the retagged pointer.
pub fn end_call(
&mut self,
extra: <M as Memory>::FrameExtra,
) -> Result<(), TerminationInfo>
pub fn end_call( &mut self, extra: <M as Memory>::FrameExtra, ) -> Result<(), TerminationInfo>
Memory model hook invoked at the end of each function call.
pub fn leak_check(&self) -> Result<(), TerminationInfo>
pub fn leak_check(&self) -> Result<(), TerminationInfo>
Check if there are any memory leaks.
pub fn check_data_races(
&self,
current_thread: Int,
_: (Set<Int>, List<Access>),
) -> Result<(), TerminationInfo>
pub fn check_data_races( &self, current_thread: Int, _: (Set<Int>, List<Access>), ) -> Result<(), TerminationInfo>
Given a list of previous accesses, checks if any of the current accesses is in a data race with any of those.
pub fn reset_accesses(&mut self) -> List<Access>
pub fn reset_accesses(&mut self) -> List<Access>
Prepare memory to track accesses of next step: reset the internal access list to be empty, and return the list of previously collected accesses.
Trait Implementations§
§impl<M> Clone for ConcurrentMemory<M>
impl<M> Clone for ConcurrentMemory<M>
§fn clone(&self) -> ConcurrentMemory<M>
fn clone(&self) -> ConcurrentMemory<M>
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreimpl<M> Copy for ConcurrentMemory<M>
§impl<M> Debug for ConcurrentMemory<M>
impl<M> Debug for ConcurrentMemory<M>
§impl<'de, M> Deserialize<'de> for ConcurrentMemory<M>where
M: Memory + Obj + Deserialize<'de>,
impl<'de, M> Deserialize<'de> for ConcurrentMemory<M>where
M: Memory + Obj + Deserialize<'de>,
§fn deserialize<__D>(
__deserializer: __D,
) -> Result<ConcurrentMemory<M>, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D,
) -> Result<ConcurrentMemory<M>, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
impl<M> Eq for ConcurrentMemory<M>
§impl<M> Hash for ConcurrentMemory<M>
impl<M> Hash for ConcurrentMemory<M>
§impl<M> Ord for ConcurrentMemory<M>
impl<M> Ord for ConcurrentMemory<M>
§fn cmp(&self, other: &ConcurrentMemory<M>) -> Ordering
fn cmp(&self, other: &ConcurrentMemory<M>) -> Ordering
1.21.0 (const: unstable) · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
1.21.0 (const: unstable) · Source§fn min(self, other: Self) -> Selfwhere
Self: Sized,
fn min(self, other: Self) -> Selfwhere
Self: Sized,
§impl<M> PartialEq for ConcurrentMemory<M>
impl<M> PartialEq for ConcurrentMemory<M>
§impl<M> PartialOrd for ConcurrentMemory<M>where
M: PartialOrd + Memory + Obj,
impl<M> PartialOrd for ConcurrentMemory<M>where
M: PartialOrd + Memory + Obj,
§impl<M> Serialize for ConcurrentMemory<M>
impl<M> Serialize for ConcurrentMemory<M>
§fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
impl<M> StructuralPartialEq for ConcurrentMemory<M>
Auto Trait Implementations§
impl<M> !Send for ConcurrentMemory<M>
impl<M> !Sync for ConcurrentMemory<M>
impl<M> Freeze for ConcurrentMemory<M>where
M: Freeze,
impl<M> RefUnwindSafe for ConcurrentMemory<M>where
M: RefUnwindSafe,
impl<M> Unpin for ConcurrentMemory<M>where
M: Unpin,
impl<M> UnsafeUnpin for ConcurrentMemory<M>where
M: UnsafeUnpin,
impl<M> UnwindSafe for ConcurrentMemory<M>where
M: UnwindSafe,
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,
§impl<Q, K> Comparable<K> for Q
impl<Q, K> Comparable<K> for Q
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
§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.§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more