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

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

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

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

Returns a copy of the value. Read more
Performs copy-assignment from source. Read more
Formats the value using the given formatter. Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more
Immutably borrows from an owned value. Read more
Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

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

The resulting type after obtaining ownership.
Creates owned data from borrowed data, usually by cloning. Read more
Uses borrowed data to replace owned data, usually by cloning. Read more
The type returned in the event of a conversion error.
Performs the conversion.
The type returned in the event of a conversion error.
Performs the conversion.

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