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§
source§impl 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,
machine: &MiriMachine<'_, '_>
) -> InterpResult<'tcx>
pub fn read<'tcx>(
&self,
alloc_id: AllocId,
range: AllocRange,
machine: &MiriMachine<'_, '_>
) -> 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,
machine: &mut MiriMachine<'_, '_>
) -> InterpResult<'tcx>
sourcepub fn write<'tcx>(
&mut self,
alloc_id: AllocId,
range: AllocRange,
machine: &mut MiriMachine<'_, '_>
) -> InterpResult<'tcx>
pub fn write<'tcx>(
&mut self,
alloc_id: AllocId,
range: AllocRange,
machine: &mut MiriMachine<'_, '_>
) -> 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,
machine: &mut MiriMachine<'_, '_>
) -> InterpResult<'tcx>
pub fn deallocate<'tcx>(
&mut self,
alloc_id: AllocId,
range: AllocRange,
machine: &mut MiriMachine<'_, '_>
) -> 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§
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 VisitTags for VClockAlloc
impl VisitTags for VClockAlloc
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§
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