pub struct GlobalStateInner {
    int_to_ptr_map: Vec<(u64, AllocId)>,
    base_addr: FxHashMap<AllocId, u64>,
    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

§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.

§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

source

pub fn new(config: &MiriConfig, stack_addr: u64) -> Self

source§

impl<'mir, 'tcx> GlobalStateInner

source

fn alloc_id_from_addr( ecx: &MiriInterpCx<'mir, 'tcx>, addr: u64 ) -> Option<AllocId>

source

pub fn expose_ptr( ecx: &mut MiriInterpCx<'mir, 'tcx>, alloc_id: AllocId, tag: BorTag ) -> InterpResult<'tcx>

source

pub fn ptr_from_addr_transmute( _ecx: &MiriInterpCx<'mir, 'tcx>, addr: u64 ) -> Pointer<Option<Provenance>>

source

pub fn ptr_from_addr_cast( ecx: &MiriInterpCx<'mir, 'tcx>, addr: u64 ) -> InterpResult<'tcx, Pointer<Option<Provenance>>>

source

fn alloc_base_addr( ecx: &MiriInterpCx<'mir, 'tcx>, alloc_id: AllocId ) -> InterpResult<'tcx, u64>

source

pub fn rel_ptr_to_addr( ecx: &MiriInterpCx<'mir, 'tcx>, ptr: Pointer<AllocId> ) -> InterpResult<'tcx, u64>

Convert a relative (tcx) pointer to an absolute address.

source

pub fn abs_ptr_to_rel( ecx: &MiriInterpCx<'mir, 'tcx>, ptr: Pointer<Provenance> ) -> Option<(AllocId, Size)>

When a pointer is used for a memory access, this computes where in which allocation the access is going.

source

fn align_addr(addr: u64, align: u64) -> u64

Shifts addr to make it aligned with align by rounding addr to the smallest multiple of align that is larger or equal to addr

Trait Implementations§

source§

impl Clone for GlobalStateInner

source§

fn clone(&self) -> GlobalStateInner

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 GlobalStateInner

source§

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

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

impl VisitTags for GlobalStateInner

source§

fn visit_tags(&self, _visit: &mut dyn FnMut(BorTag))

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for Twhere T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for Twhere U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T> ToOwned for Twhere T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for Twhere U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for Twhere 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: 104 bytes