Struct miri::stacked_borrows::GlobalStateInner
source · pub struct GlobalStateInner {
next_ptr_tag: SbTag,
base_ptr_tags: FxHashMap<AllocId, SbTag>,
next_call_id: CallId,
protected_tags: FxHashSet<SbTag>,
tracked_pointer_tags: FxHashSet<SbTag>,
tracked_call_ids: FxHashSet<CallId>,
retag_fields: bool,
}
Expand description
Extra global state, available to the memory access hooks.
Fields
next_ptr_tag: SbTag
Next unused pointer ID (tag).
Table storing the “base” tag for each allocation. The base tag is the one used for the initial pointer. We need this in a separate table to handle cyclic statics.
next_call_id: CallId
Next unused call ID (for protectors).
All currently protected tags.
An item is protected if its tag is in this set, and it has the “protected” bit set.
We add tags to this when they are created with a protector in reborrow
, and
we remove tags from this when the call which is protecting them returns, in
GlobalStateInner::end_call
. See Stack::item_popped
for more details.
The pointer ids to trace
tracked_call_ids: FxHashSet<CallId>
The call ids to trace
retag_fields: bool
Whether to recurse into datatypes when searching for pointers to retag.
Implementations
sourceimpl GlobalStateInner
impl GlobalStateInner
Utilities for initialization and ID generation
pub fn new(
tracked_pointer_tags: FxHashSet<SbTag>,
tracked_call_ids: FxHashSet<CallId>,
retag_fields: bool
) -> Self
sourcefn new_ptr(&mut self) -> SbTag
fn new_ptr(&mut self) -> SbTag
Generates a new pointer tag. Remember to also check track_pointer_tags and log its creation!
pub fn new_frame(&mut self) -> FrameExtra
pub fn end_call(&mut self, frame: &FrameData<'_>)
pub fn base_ptr_tag(&mut self, id: AllocId) -> SbTag
Trait Implementations
Auto Trait Implementations
impl RefUnwindSafe for GlobalStateInner
impl Send for GlobalStateInner
impl Sync for GlobalStateInner
impl Unpin for GlobalStateInner
impl UnwindSafe for GlobalStateInner
Blanket Implementations
sourceimpl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
impl<V, T> VZip<V> for Twhere
V: MultiLane<T>,
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: 152 bytes