miri::concurrency::data_race

Type Alias AllocState

Source
pub type AllocState = VClockAlloc;

Aliased Type§

struct AllocState {
    alloc_ranges: RefCell<RangeMap<MemoryCellClocks>>,
}

Fields§

§alloc_ranges: RefCell<RangeMap<MemoryCellClocks>>

Assigning each byte a MemoryCellClocks.

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

Implementations

Source§

impl VClockAlloc

Source

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.

Source

fn find_gt_index(l: &VClock, r: &VClock) -> Option<VectorIdx>

Source

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.

Source

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.

Source

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

Source§

fn clone(&self) -> VClockAlloc

Returns a copy of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for VClockAlloc

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl VisitProvenance for VClockAlloc

Source§

fn visit_provenance(&self, _visit: &mut VisitWith<'_>)