Struct miri::concurrency::data_race::VClockAlloc
source · [−]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
sourceimpl VClockAlloc
impl VClockAlloc
sourcepub fn new_allocation(
global: &GlobalState,
thread_mgr: &ThreadManager<'_, '_>,
len: Size,
kind: MemoryKind<MiriMemoryKind>
) -> VClockAlloc
pub fn new_allocation(
global: &GlobalState,
thread_mgr: &ThreadManager<'_, '_>,
len: Size,
kind: MemoryKind<MiriMemoryKind>
) -> 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<'_, '_>,
range: &MemoryCellClocks,
action: &str,
is_atomic: bool,
ptr_dbg: Pointer<AllocId>
) -> InterpResult<'tcx>
fn report_data_race<'tcx>(
global: &GlobalState,
thread_mgr: &ThreadManager<'_, '_>,
range: &MemoryCellClocks,
action: &str,
is_atomic: bool,
ptr_dbg: Pointer<AllocId>
) -> 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.
sourcepub(super) fn race_free_with_atomic(
&self,
range: AllocRange,
global: &GlobalState,
thread_mgr: &ThreadManager<'_, '_>
) -> bool
pub(super) fn race_free_with_atomic(
&self,
range: AllocRange,
global: &GlobalState,
thread_mgr: &ThreadManager<'_, '_>
) -> bool
Detect racing atomic read and writes (not data races) on every byte of the current access range
sourcepub fn read<'tcx>(
&self,
alloc_id: AllocId,
range: AllocRange,
global: &GlobalState,
thread_mgr: &ThreadManager<'_, '_>
) -> InterpResult<'tcx>
pub fn read<'tcx>(
&self,
alloc_id: AllocId,
range: AllocRange,
global: &GlobalState,
thread_mgr: &ThreadManager<'_, '_>
) -> InterpResult<'tcx>
Detect data-races for an unsynchronized read operation, 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.
fn unique_access<'tcx>(
&mut self,
alloc_id: AllocId,
range: AllocRange,
write_type: WriteType,
global: &mut GlobalState,
thread_mgr: &ThreadManager<'_, '_>
) -> InterpResult<'tcx>
sourcepub fn write<'tcx>(
&mut self,
alloc_id: AllocId,
range: AllocRange,
global: &mut GlobalState,
thread_mgr: &ThreadManager<'_, '_>
) -> InterpResult<'tcx>
pub fn write<'tcx>(
&mut self,
alloc_id: AllocId,
range: AllocRange,
global: &mut GlobalState,
thread_mgr: &ThreadManager<'_, '_>
) -> InterpResult<'tcx>
Detect data-races for an unsynchronized write operation, will not perform
data-race threads 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
sourcepub fn deallocate<'tcx>(
&mut self,
alloc_id: AllocId,
range: AllocRange,
global: &mut GlobalState,
thread_mgr: &ThreadManager<'_, '_>
) -> InterpResult<'tcx>
pub fn deallocate<'tcx>(
&mut self,
alloc_id: AllocId,
range: AllocRange,
global: &mut GlobalState,
thread_mgr: &ThreadManager<'_, '_>
) -> InterpResult<'tcx>
Detect data-races for an unsynchronized deallocate operation, will not perform
data-race threads 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
Trait Implementations
sourceimpl Clone for VClockAlloc
impl Clone for VClockAlloc
sourcefn clone(&self) -> VClockAlloc
fn clone(&self) -> VClockAlloc
Returns a copy of the value. Read more
1.0.0 · sourcefn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source. Read more
Auto Trait Implementations
impl !RefUnwindSafe for VClockAlloc
impl Send for VClockAlloc
impl !Sync for VClockAlloc
impl Unpin for VClockAlloc
impl UnwindSafe for VClockAlloc
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
fn vzip(self) -> V
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