Global pointer-tag and protector bookkeeping from Miri's
borrow_tracker::GlobalStateInner, FrameState, and ProtectorKind.
This is the borrow-tracker bookkeeping layer only. Allocation tree mutations, protector-triggered reads on stack pop, and memory accesses live in separate Tree Borrows operations.
Miri's two protector strengths.
- WeakProtector : ProtectorKind
- StrongProtector : ProtectorKind
Instances For
Equations
- One or more equations did not get rendered due to their size.
Instances For
Equations
Finite map from source BorTag to ProtectorKind.
The source uses an FxHashMap, whose iteration order is not semantic here. This representation preserves the observable map operations (insert replaces, remove deletes, lookup returns the current kind).
- entries : Array (Memory.BorTag × ProtectorKind)
Instances For
Equations
Instances For
Equations
Equations
- One or more equations did not get rendered due to their size.
Instances For
Equations
- map.get tag = Option.map Prod.snd (Array.find? (fun (entry : Miri.Memory.BorTag × Miri.TreeBorrows.ProtectorKind) => entry.fst == tag) map.entries)
Instances For
Instances For
Equations
- One or more equations did not get rendered due to their size.
Instances For
Equations
- map.remove tag = { entries := Array.filter (fun (entry : Miri.Memory.BorTag × Miri.TreeBorrows.ProtectorKind) => entry.fst != tag) map.entries }
Instances For
Instances For
Tags protected by one call frame, paired with the allocation whose Tree Borrows state must receive its release operation before the frame ends.
- protectedTags : Array (Memory.AllocId × Memory.BorTag)
Instances For
Equations
Instances For
Equations
Equations
- One or more equations did not get rendered due to their size.
Instances For
Equations
Equations
- frame.addProtector allocId tag = { protectedTags := frame.protectedTags.push (allocId, tag) }
Instances For
Provenance pairs visited by the source VisitProvenance implementation.
The global protected-tag table is intentionally not separately traced.
Equations
- frame.liveBorrowTags = frame.protectedTags
Instances For
- pointerTagOverflow (tag : Memory.BorTag) : GlobalStateError
Instances For
Equations
- One or more equations did not get rendered due to their size.
Instances For
Equations
- One or more equations did not get rendered due to their size.
Instances For
Equations
The semantic fields from Miri's GlobalStateInner that govern pointer
tag allocation and protector bookkeeping. Root allocation IDs and tracked
tag IDs use arrays as finite maps/sets; their insertion and lookup behavior
matches the source's map/set API.
- nextPointerTag : Memory.BorTag
- rootPointerTags : Array (Memory.AllocId × Memory.BorTag)
- protectedTags : ProtectedTags
- trackedPointerTags : Array Memory.BorTag
Instances For
Equations
- One or more equations did not get rendered due to their size.
Instances For
Equations
Equations
- One or more equations did not get rendered due to their size.
Instances For
Equations
Equations
- Miri.TreeBorrows.GlobalState.new trackedPointerTags = { trackedPointerTags := trackedPointerTags }
Instances For
Equations
- state.isTrackedPointerTag tag = state.trackedPointerTags.contains tag
Instances For
Equations
- state.rootTag? allocId = Option.map Prod.snd (Array.find? (fun (entry : Miri.Memory.AllocId × Miri.Memory.BorTag) => entry.fst == allocId) state.rootPointerTags)
Instances For
Source GlobalStateInner::new_ptr: return the current tag and advance the
counter with checked BorTag::succ. Miri unwraps overflow; this port retains
it as an explicit error.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Source root_ptr_tag: return the stable per-allocation root tag, creating
one with new_ptr when absent.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Source remove_unreachable_allocs, where liveAllocIds is the set passed
by the allocation collector.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Add the two source-side records created when a reborrow installs a protector: one frame-owned (allocation, tag) pair and one global tag-to-kind entry used by access transitions.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Source end_call: remove every tag listed by the frame from the global
protected-tag map. Tree Borrows' release operation is performed before this
bookkeeping step by on_stack_pop.
Equations
- One or more equations did not get rendered due to their size.
Instances For
The global map is only a lookup index; protected tags remain live through their frame-owned provenance records.
Equations
- One or more equations did not get rendered due to their size.