pub struct VClockAlloc {
alloc_ranges: RefCell<RangeMap<MemoryCellClocks>>,
}
Expand description
Vector clock metadata for a logical memory allocation.
Fields§
§alloc_ranges: RefCell<RangeMap<MemoryCellClocks>>
Assigning each byte a MemoryCellClocks.
Implementations§
Source§impl VClockAlloc
impl VClockAlloc
Sourcepub fn new_allocation(
global: &GlobalState,
thread_mgr: &ThreadManager<'_>,
len: Size,
kind: MemoryKind,
current_span: Span,
) -> VClockAlloc
pub fn new_allocation( global: &GlobalState, thread_mgr: &ThreadManager<'_>, len: Size, kind: MemoryKind, current_span: Span, ) -> VClockAlloc
Create a new data-race detector for newly allocated memory.
fn find_gt_index(l: &VClock, r: &VClock) -> Option<VectorIdx>
Sourcefn report_data_race<'tcx>(
global: &GlobalState,
thread_mgr: &ThreadManager<'_>,
mem_clocks: &MemoryCellClocks,
access: AccessType,
access_size: Size,
ptr_dbg: Pointer<AllocId>,
ty: Option<Ty<'_>>,
) -> InterpResult<'tcx>
fn report_data_race<'tcx>( global: &GlobalState, thread_mgr: &ThreadManager<'_>, mem_clocks: &MemoryCellClocks, access: AccessType, access_size: Size, ptr_dbg: Pointer<AllocId>, ty: Option<Ty<'_>>, ) -> InterpResult<'tcx>
Report a data-race found in the program.
This finds the two racing threads and the type
of data-race that occurred. This will also
return info about the memory location the data-race
occurred in. The ty
parameter is used for diagnostics, letting
the user know which type was involved in the access.
Sourcepub fn read<'tcx>(
&self,
alloc_id: AllocId,
access_range: AllocRange,
read_type: NaReadType,
ty: Option<Ty<'_>>,
machine: &MiriMachine<'_>,
) -> InterpResult<'tcx>
pub fn read<'tcx>( &self, alloc_id: AllocId, access_range: AllocRange, read_type: NaReadType, ty: Option<Ty<'_>>, machine: &MiriMachine<'_>, ) -> InterpResult<'tcx>
Detect data-races for an unsynchronized read operation. It will not perform
data-race detection if race_detecting()
is false, either due to no threads
being created or if it is temporarily disabled during a racy read or write
operation for which data-race detection is handled separately, for example
atomic read operations. The ty
parameter is used for diagnostics, letting
the user know which type was read.
Sourcepub fn write<'tcx>(
&mut self,
alloc_id: AllocId,
access_range: AllocRange,
write_type: NaWriteType,
ty: Option<Ty<'_>>,
machine: &mut MiriMachine<'_>,
) -> InterpResult<'tcx>
pub fn write<'tcx>( &mut self, alloc_id: AllocId, access_range: AllocRange, write_type: NaWriteType, ty: Option<Ty<'_>>, machine: &mut MiriMachine<'_>, ) -> InterpResult<'tcx>
Detect data-races for an unsynchronized write operation. It will not perform
data-race detection if race_detecting()
is false, either due to no threads
being created or if it is temporarily disabled during a racy read or write
operation. The ty
parameter is used for diagnostics, letting
the user know which type was written.
Trait Implementations§
Source§impl Clone for VClockAlloc
impl Clone for VClockAlloc
Source§fn clone(&self) -> VClockAlloc
fn clone(&self) -> VClockAlloc
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moreSource§impl Debug for VClockAlloc
impl Debug for VClockAlloc
Source§impl VisitProvenance for VClockAlloc
impl VisitProvenance for VClockAlloc
fn visit_provenance(&self, _visit: &mut VisitWith<'_>)
Auto Trait Implementations§
impl !Freeze for VClockAlloc
impl !RefUnwindSafe for VClockAlloc
impl Send for VClockAlloc
impl !Sync for VClockAlloc
impl Unpin for VClockAlloc
impl UnwindSafe for VClockAlloc
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,
Layout§
Note: Most layout information is completely unstable and may even differ between compilations. The only exception is types with certain repr(...)
attributes. Please see the Rust Reference's “Type Layout” chapter for details on type layout guarantees.
Size: 32 bytes