Struct miri::alloc_addresses::GlobalStateInner
source · pub struct GlobalStateInner {
int_to_ptr_map: Vec<(u64, AllocId)>,
base_addr: FxHashMap<AllocId, u64>,
reuse: ReusePool,
exposed: FxHashSet<AllocId>,
next_base_addr: u64,
provenance_mode: ProvenanceMode,
}
Fields§
§int_to_ptr_map: Vec<(u64, AllocId)>
This is used as a map between the address of each allocation and its AllocId
. It is always
sorted by address. We cannot use a HashMap
since we can be given an address that is offset
from the base address, and we need to find the AllocId
it belongs to. This is not the
full inverse of base_addr
; dead allocations have been removed.
base_addr: FxHashMap<AllocId, u64>
The base address for each allocation. We cannot put that into
AllocExtra
because function pointers also have a base address, and
they do not have an AllocExtra
.
This is the inverse of int_to_ptr_map
.
reuse: ReusePool
A pool of addresses we can reuse for future allocations.
exposed: FxHashSet<AllocId>
Whether an allocation has been exposed or not. This cannot be put
into AllocExtra
for the same reason as base_addr
.
next_base_addr: u64
This is used as a memory address when a new pointer is casted to an integer. It is always larger than any address that was previously made part of a block.
provenance_mode: ProvenanceMode
The provenance to use for int2ptr casts
Implementations§
source§impl GlobalStateInner
impl GlobalStateInner
pub fn new(config: &MiriConfig, stack_addr: u64) -> Self
pub fn remove_unreachable_allocs(&mut self, allocs: &LiveAllocs<'_, '_, '_>)
Trait Implementations§
source§impl Debug for GlobalStateInner
impl Debug for GlobalStateInner
source§impl VisitProvenance for GlobalStateInner
impl VisitProvenance for GlobalStateInner
fn visit_provenance(&self, _visit: &mut VisitWith<'_>)
Auto Trait Implementations§
impl !DynSend for GlobalStateInner
impl !DynSync for GlobalStateInner
impl Freeze for GlobalStateInner
impl RefUnwindSafe for GlobalStateInner
impl Send for GlobalStateInner
impl Sync for GlobalStateInner
impl Unpin for GlobalStateInner
impl UnwindSafe for GlobalStateInner
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, R> CollectAndApply<T, R> for T
impl<T, R> CollectAndApply<T, R> for T
§impl<T> Filterable for T
impl<T> Filterable for T
source§impl<T> Instrument for T
impl<T> Instrument for T
source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
source§impl<P> IntoQueryParam<P> for P
impl<P> IntoQueryParam<P> for P
fn into_query_param(self) -> P
source§impl<T> MaybeResult<T> for T
impl<T> MaybeResult<T> for T
§impl<T> Pointable for T
impl<T> Pointable for T
source§impl<'tcx, T> ToPredicate<'tcx, T> for T
impl<'tcx, T> ToPredicate<'tcx, T> for T
fn to_predicate(self, _tcx: TyCtxt<'tcx>) -> T
source§impl<Tcx, T> Value<Tcx> for Twhere
Tcx: DepContext,
impl<Tcx, T> Value<Tcx> for Twhere
Tcx: DepContext,
default fn from_cycle_error( tcx: Tcx, cycle_error: &CycleError, _guar: ErrorGuaranteed ) -> T
source§impl<T> WithSubscriber for T
impl<T> WithSubscriber for T
source§fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
source§fn with_current_subscriber(self) -> WithDispatch<Self>
fn with_current_subscriber(self) -> WithDispatch<Self>
impl<'a, T> Captures<'a> for Twhere
T: ?Sized,
impl<'a, T> Captures<'a> for Twhere
T: ?Sized,
impl<T> ErasedDestructor for Twhere
T: 'static,
impl<T> MaybeSendSync for T
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: 144 bytes