Tree Borrows adapters for the three Miri Machine memory hooks.
The caller order in pinned machine.rs is represented here: optional
allocation diagnostics, data-race handling, Tree Borrows, synchronization
objects, and (for deallocation) span/address-map release. The data-race,
sync-object, diagnostic, span, and allocation-ID operations remain callbacks;
this module does not pretend to implement those machine subsystems. Read and
write adapters update the live allocation's BorrowTree extra before
returning a Tree Borrows failure, as the source mutates AllocExtra in place.
- Read : SyncAccessKind
- Write : SyncAccessKind
- Dealloc : SyncAccessKind
Instances For
Equations
- One or more equations did not get rendered due to their size.
Instances For
- Read (range : Memory.AllocRange) : AccessDiagnostic
- Write (range : Memory.AllocRange) : AccessDiagnostic
- Freed : AccessDiagnostic
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
A finite ordered representation of Miri's per-allocation BTreeMap<Size, Box<dyn SyncObj>>. Insertion keeps keys unique and ascending, so the access
walks below have the source map's iteration order.
Instances For
Instances For
Equations
- One or more equations did not get rendered due to their size.
Instances For
Equations
Instances For
Equations
- One or more equations did not get rendered due to their size.
Instances For
Allocation-indexed sync metadata. Miri stores one offset map inside each
AllocExtra; this outer index lets a single mem_copy_repeatedly context
carry the source and destination allocation maps independently.
- allocations : Array (Memory.AllocId × SyncObjectMap Obj)
Instances For
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
- One or more equations did not get rendered due to their size.
Instances For
The AllocExtra-local sync map plus the global state threaded through
Miri's machine callbacks. The caller supplies the sync map for the allocation
currently being accessed and stores the returned map with that allocation.
- state : State
- syncObjects : SyncObjectStore Obj
- trackAllocAccesses : Bool
- trackedAllocIds : Array Memory.AllocId
Instances For
Hooks corresponding to the portions of machine.rs and
concurrency::sync::SyncObj outside the Tree Borrows subtree. Data-race hooks
must dispatch the configured Miri handler (None or vector clocks),
including its per-allocation-handler invariant and weak-memory write effect.
- protectedTags : ProtectedTags
- emitDiagnostic : State → Memory.AllocId → AccessDiagnostic → State
- dataRaceRead : State → Memory.Pointer (Option Memory.Provenance) → Memory.AllocId → Memory.AllocRange → Memory.MachineHookResult State Unit
- dataRaceWrite : State → Memory.Pointer (Option Memory.Provenance) → Memory.AllocId → Memory.AllocRange → Memory.MachineHookResult State Unit
- dataRaceDeallocate : State → Memory.Pointer (Option Memory.Provenance) → Memory.AllocId → ABI.Size → Memory.MemoryKind MachineKind → Memory.MachineHookResult State Unit
- syncOnAccess : State → Obj → SyncAccessKind → Memory.MachineHookResult State Unit
- deleteOnWrite : Obj → Bool
- recordDeallocatedSpan : State → Memory.AllocId → State
- freeAllocId : State → Memory.AllocId → ABI.Size → ABI.Align → Memory.MemoryKind MachineKind → State
Instances For
- memory : Memory.MemoryState Memory.Provenance BorrowTree MachineKind
- context : Context State Obj
Instances For
Pinned MiriMachine::before_memory_read after optional diagnostic. The
data-race hook runs first. The actual live allocation extra is then updated by
the Tree Borrows access, and a Tree error prevents all sync-object callbacks.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Pinned MiriMachine::before_memory_write after optional diagnostic. Sync
objects are deleted only after every overlapping object's write check
succeeds, matching the source's collect-then-remove loop.
Equations
- One or more equations did not get rendered due to their size.
Instances For
- allocation : Memory.Allocation Memory.Provenance BorrowTree
- context : Context State Obj
Instances For
Pinned MiriMachine::before_memory_deallocation. MemoryLifecycle.deallocatePtr
has already removed the allocation from its live map when it invokes this
callback. The tree result is retained in allocation for callers that need to
inspect a failed hook; the lifecycle caller still preserves its source removal
on failure.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Adapt the source-ordered Tree Borrows hooks to the existing mem_copy
read/write callback boundary. Pointer resolution, before_alloc_access, and
the actual Miri data-race handler remain explicit caller inputs.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Adapt the ordered tree/race/sync/free sequence to
MemoryLifecycleHooks.beforeDeallocation. The surrounding lifecycle owns
pointer resolution, live-map removal, and dead-allocation caching; the
adapter returns the explicit memory successor unchanged.
Equations
- One or more equations did not get rendered due to their size.