Core local-allocation lifecycle transitions from rustc's interpreter
memory.rs. Allocation IDs, Miri machine state, pointer lookup, native
allocation bytes, memory-copy access checks, and machine deallocation hooks are
explicit inputs. State changes performed before a source error are retained.
- stack {MachineKind : Type} : MemoryKind MachineKind
- callerLocation {MachineKind : Type} : MemoryKind MachineKind
- machine {MachineKind : Type} (kind : MachineKind) : MemoryKind MachineKind
Instances For
Equations
- Miri.Memory.instDecidableEqMemoryKind.decEq Miri.Memory.MemoryKind.stack Miri.Memory.MemoryKind.stack = isTrue ⋯
- Miri.Memory.instDecidableEqMemoryKind.decEq Miri.Memory.MemoryKind.stack Miri.Memory.MemoryKind.callerLocation = isFalse ⋯
- Miri.Memory.instDecidableEqMemoryKind.decEq Miri.Memory.MemoryKind.stack (Miri.Memory.MemoryKind.machine kind) = isFalse ⋯
- Miri.Memory.instDecidableEqMemoryKind.decEq Miri.Memory.MemoryKind.callerLocation Miri.Memory.MemoryKind.stack = isFalse ⋯
- Miri.Memory.instDecidableEqMemoryKind.decEq Miri.Memory.MemoryKind.callerLocation Miri.Memory.MemoryKind.callerLocation = isTrue ⋯
- Miri.Memory.instDecidableEqMemoryKind.decEq Miri.Memory.MemoryKind.callerLocation (Miri.Memory.MemoryKind.machine kind) = isFalse ⋯
- Miri.Memory.instDecidableEqMemoryKind.decEq (Miri.Memory.MemoryKind.machine kind) Miri.Memory.MemoryKind.stack = isFalse ⋯
- Miri.Memory.instDecidableEqMemoryKind.decEq (Miri.Memory.MemoryKind.machine kind) Miri.Memory.MemoryKind.callerLocation = isFalse ⋯
- Miri.Memory.instDecidableEqMemoryKind.decEq (Miri.Memory.MemoryKind.machine a) (Miri.Memory.MemoryKind.machine b) = if h : a = b then h ▸ isTrue ⋯ else isFalse ⋯
Instances For
Equations
- One or more equations did not get rendered due to their size.
Instances For
Equations
- function : GlobalAllocationKind
- vtable : GlobalAllocationKind
- typeId : GlobalAllocationKind
- static : GlobalAllocationKind
- memory : GlobalAllocationKind
Instances For
Equations
Equations
- One or more equations did not get rendered due to their size.
Instances For
The source-level shape of a compiler global. Memory contents use CTFE
provenance until adjustGlobalAllocation converts them for the selected
machine. A static stores its identity and source predicates; its initializer
is evaluated only when the source get_global_alloc path is taken.
- memory (allocation : Allocation) : GlobalAllocationPayload
- function : GlobalAllocationPayload
- vtable : GlobalAllocationPayload
- typeId : GlobalAllocationPayload
- static (definition : Nat) (isStatic threadLocal foreignItem : Bool) : GlobalAllocationPayload
Instances For
- kind : MemoryKind MachineKind
- allocation : Allocation Prov Extra
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
Global allocation metadata is indexed by the runtime rustc AllocId.
Exporter graph IDs are canonical graph indices, so imported IDs are kept in a
separate explicit map rather than treated as runtime IDs.
- allocId : AllocId
- kind : GlobalAllocationKind
- size : ABI.Size
- align : ABI.Align
- mutability : Mutability
- payload : Option GlobalAllocationPayload
Instances For
- exhausted : AllocationIdError
- alreadyIssued (allocId : AllocId) : AllocationIdError
Instances For
Equations
- One or more equations did not get rendered due to their size.
- Miri.Memory.instDecidableEqAllocationIdError.decEq Miri.Memory.AllocationIdError.exhausted Miri.Memory.AllocationIdError.exhausted = isTrue ⋯
- Miri.Memory.instDecidableEqAllocationIdError.decEq Miri.Memory.AllocationIdError.exhausted (Miri.Memory.AllocationIdError.alreadyIssued allocId) = isFalse ⋯
- Miri.Memory.instDecidableEqAllocationIdError.decEq (Miri.Memory.AllocationIdError.alreadyIssued allocId) Miri.Memory.AllocationIdError.exhausted = isFalse ⋯
Instances For
Equations
Equations
- One or more equations did not get rendered due to their size.
Instances For
- duplicateExportId (exportId : Nat) : MemoryMetadataError
- duplicateRuntimeId (allocId : AllocId) : MemoryMetadataError
- globalIdAlreadyPresent (allocId : AllocId) : MemoryMetadataError
- missingExportId (exportId : Nat) : MemoryMetadataError
Instances For
Equations
- One or more equations did not get rendered due to their size.
- Miri.Memory.instDecidableEqMemoryMetadataError.decEq (Miri.Memory.MemoryMetadataError.duplicateExportId exportId) (Miri.Memory.MemoryMetadataError.duplicateRuntimeId allocId) = isFalse ⋯
- Miri.Memory.instDecidableEqMemoryMetadataError.decEq (Miri.Memory.MemoryMetadataError.duplicateExportId exportId) (Miri.Memory.MemoryMetadataError.globalIdAlreadyPresent allocId) = isFalse ⋯
- Miri.Memory.instDecidableEqMemoryMetadataError.decEq (Miri.Memory.MemoryMetadataError.duplicateExportId exportId) (Miri.Memory.MemoryMetadataError.missingExportId exportId_1) = isFalse ⋯
- Miri.Memory.instDecidableEqMemoryMetadataError.decEq (Miri.Memory.MemoryMetadataError.duplicateRuntimeId allocId) (Miri.Memory.MemoryMetadataError.duplicateExportId exportId) = isFalse ⋯
- Miri.Memory.instDecidableEqMemoryMetadataError.decEq (Miri.Memory.MemoryMetadataError.duplicateRuntimeId allocId) (Miri.Memory.MemoryMetadataError.globalIdAlreadyPresent allocId_1) = isFalse ⋯
- Miri.Memory.instDecidableEqMemoryMetadataError.decEq (Miri.Memory.MemoryMetadataError.duplicateRuntimeId allocId) (Miri.Memory.MemoryMetadataError.missingExportId exportId) = isFalse ⋯
- Miri.Memory.instDecidableEqMemoryMetadataError.decEq (Miri.Memory.MemoryMetadataError.globalIdAlreadyPresent allocId) (Miri.Memory.MemoryMetadataError.duplicateExportId exportId) = isFalse ⋯
- Miri.Memory.instDecidableEqMemoryMetadataError.decEq (Miri.Memory.MemoryMetadataError.globalIdAlreadyPresent allocId) (Miri.Memory.MemoryMetadataError.duplicateRuntimeId allocId_1) = isFalse ⋯
- Miri.Memory.instDecidableEqMemoryMetadataError.decEq (Miri.Memory.MemoryMetadataError.globalIdAlreadyPresent allocId) (Miri.Memory.MemoryMetadataError.missingExportId exportId) = isFalse ⋯
- Miri.Memory.instDecidableEqMemoryMetadataError.decEq (Miri.Memory.MemoryMetadataError.missingExportId exportId) (Miri.Memory.MemoryMetadataError.duplicateExportId exportId_1) = isFalse ⋯
- Miri.Memory.instDecidableEqMemoryMetadataError.decEq (Miri.Memory.MemoryMetadataError.missingExportId exportId) (Miri.Memory.MemoryMetadataError.duplicateRuntimeId allocId) = isFalse ⋯
- Miri.Memory.instDecidableEqMemoryMetadataError.decEq (Miri.Memory.MemoryMetadataError.missingExportId exportId) (Miri.Memory.MemoryMetadataError.globalIdAlreadyPresent allocId) = isFalse ⋯
Instances For
Equations
Equations
- One or more equations did not get rendered due to their size.
Instances For
- notFound (allocId : AllocId) : GlobalAccessError
- dereferenceFunctionPointer (allocId : AllocId) : GlobalAccessError
- dereferenceVTablePointer (allocId : AllocId) : GlobalAccessError
- dereferenceTypeIdPointer (allocId : AllocId) : GlobalAccessError
- staticNotAStatic (allocId : AllocId) (definition : Nat) : GlobalAccessError
- threadLocalStatic (allocId : AllocId) (definition : Nat) : GlobalAccessError
- unsupportedExternStatic (allocId : AllocId) (definition : Nat) : GlobalAccessError
- payloadKindMismatch (allocId : AllocId) (kind payloadKind : GlobalAllocationKind) : GlobalAccessError
- hookFailure (hook message : String) : GlobalAccessError
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
- globalAccess (reason : GlobalAccessError) : MemoryAccessError
- allocationLookup (reason : AllocationLookupError) : MemoryAccessError
- readOnlyAllocation (allocId : AllocId) : MemoryAccessError
- missingGlobalMachineKind (allocId : AllocId) : MemoryAccessError
Instances For
Equations
- One or more equations did not get rendered due to their size.
- Miri.Memory.instDecidableEqMemoryAccessError.decEq (Miri.Memory.MemoryAccessError.globalAccess a) (Miri.Memory.MemoryAccessError.globalAccess b) = if h : a = b then h ▸ isTrue ⋯ else isFalse ⋯
- Miri.Memory.instDecidableEqMemoryAccessError.decEq (Miri.Memory.MemoryAccessError.globalAccess reason) (Miri.Memory.MemoryAccessError.allocationLookup reason_1) = isFalse ⋯
- Miri.Memory.instDecidableEqMemoryAccessError.decEq (Miri.Memory.MemoryAccessError.globalAccess reason) (Miri.Memory.MemoryAccessError.readOnlyAllocation allocId) = isFalse ⋯
- Miri.Memory.instDecidableEqMemoryAccessError.decEq (Miri.Memory.MemoryAccessError.globalAccess reason) (Miri.Memory.MemoryAccessError.missingGlobalMachineKind allocId) = isFalse ⋯
- Miri.Memory.instDecidableEqMemoryAccessError.decEq (Miri.Memory.MemoryAccessError.allocationLookup reason) (Miri.Memory.MemoryAccessError.globalAccess reason_1) = isFalse ⋯
- Miri.Memory.instDecidableEqMemoryAccessError.decEq (Miri.Memory.MemoryAccessError.allocationLookup reason) (Miri.Memory.MemoryAccessError.readOnlyAllocation allocId) = isFalse ⋯
- Miri.Memory.instDecidableEqMemoryAccessError.decEq (Miri.Memory.MemoryAccessError.allocationLookup reason) (Miri.Memory.MemoryAccessError.missingGlobalMachineKind allocId) = isFalse ⋯
- Miri.Memory.instDecidableEqMemoryAccessError.decEq (Miri.Memory.MemoryAccessError.readOnlyAllocation allocId) (Miri.Memory.MemoryAccessError.globalAccess reason) = isFalse ⋯
- Miri.Memory.instDecidableEqMemoryAccessError.decEq (Miri.Memory.MemoryAccessError.readOnlyAllocation allocId) (Miri.Memory.MemoryAccessError.allocationLookup reason) = isFalse ⋯
- Miri.Memory.instDecidableEqMemoryAccessError.decEq (Miri.Memory.MemoryAccessError.readOnlyAllocation allocId) (Miri.Memory.MemoryAccessError.missingGlobalMachineKind allocId_1) = isFalse ⋯
- Miri.Memory.instDecidableEqMemoryAccessError.decEq (Miri.Memory.MemoryAccessError.missingGlobalMachineKind allocId) (Miri.Memory.MemoryAccessError.globalAccess reason) = isFalse ⋯
- Miri.Memory.instDecidableEqMemoryAccessError.decEq (Miri.Memory.MemoryAccessError.missingGlobalMachineKind allocId) (Miri.Memory.MemoryAccessError.allocationLookup reason) = isFalse ⋯
- Miri.Memory.instDecidableEqMemoryAccessError.decEq (Miri.Memory.MemoryAccessError.missingGlobalMachineKind allocId) (Miri.Memory.MemoryAccessError.readOnlyAllocation allocId_1) = isFalse ⋯
Instances For
Equations
Equations
- One or more equations did not get rendered due to their size.
Instances For
- lookup (reason : AllocationLookupError) : LiveAllocationInfoError
- useAfterFree (allocId : AllocId) (message : CheckInAllocMsg) : LiveAllocationInfoError
Instances For
Equations
- One or more equations did not get rendered due to their size.
- Miri.Memory.instDecidableEqLiveAllocationInfoError.decEq (Miri.Memory.LiveAllocationInfoError.lookup reason) (Miri.Memory.LiveAllocationInfoError.useAfterFree allocId message) = isFalse ⋯
- Miri.Memory.instDecidableEqLiveAllocationInfoError.decEq (Miri.Memory.LiveAllocationInfoError.useAfterFree allocId message) (Miri.Memory.LiveAllocationInfoError.lookup reason) = isFalse ⋯
Instances For
Equations
Equations
- One or more equations did not get rendered due to their size.
Instances For
- nextAllocId : UInt64
Mirrors rustc's
AllocMap::next_id, which starts at one and increments monotonically for every reserved local or imported-global allocation. - idSupplyExhausted : Bool
- issuedIdTable : Miri.Memory.KeyedArray UInt64 Miri.Memory.AllocId fun (id : Miri.Memory.AllocId) => id.value
- live : Array (AllocId × LocalAllocation Prov Extra MachineKind)
- dead : Array DeadAllocation
- globalTable : Miri.Memory.KeyedArray UInt64 Miri.Memory.GlobalAllocation fun (global : Miri.Memory.GlobalAllocation) => global.allocId.value
- importedGlobalTable : Miri.Memory.KeyedArray Nat (Nat × Miri.Memory.AllocId) Prod.fst
- extraFnPtrTable : Miri.Memory.KeyedArray UInt64 Miri.Memory.AllocId fun (id : Miri.Memory.AllocId) => id.value
- vaListTable : Miri.Memory.KeyedArray UInt64 Miri.Memory.AllocId fun (id : Miri.Memory.AllocId) => id.value
TCX global byte dedup keys, sharing this allocation supply. Imported compiler identities are seeded only from exact salt-query evidence.
- byteGlobalKeysReady : Bool
- sourceAllocIdWorldActive : Bool
Optional exact post-export TCX source-number world. Runtime IDs remain dense; this crosswalk retains raw rustc identities for diagnostics.
- sourceAllocIdNext : UInt64
- sourceAllocIdExhausted : Bool
- sourceAllocIdByRuntimeTable : Miri.Memory.KeyedArray UInt64 (Miri.Memory.AllocId × UInt64) fun (pair : Miri.Memory.AllocId × UInt64) => pair.fst.value
- runtimeBySourceAllocIdTable : Miri.Memory.KeyedArray UInt64 (UInt64 × Miri.Memory.AllocId) Prod.fst
- sourceByteImageFamilyComplete : Bool
Instances For
- allocation (error : AllocError) : MemoryLifecycleError
- allocationIdError (error : AllocationIdError) : MemoryLifecycleError
- metadataError (error : MemoryMetadataError) : MemoryLifecycleError
- hookFailure (hook message : String) : MemoryLifecycleError
- allocationTooLarge (size maximum : ABI.Size) : MemoryLifecycleError
- allocationNotLocal (allocId : AllocId) : MemoryLifecycleError
- dynamicallyAllocatingGlobal : MemoryLifecycleError
- danglingPointer (address : UInt64) : MemoryLifecycleError
- nonzeroAllocationOffset (operation : String) (allocId : AllocId) (offset : ABI.Size) : MemoryLifecycleError
- globalAllocationDeallocation (allocId : AllocId) (kind : GlobalAllocationKind) : MemoryLifecycleError
- useAfterFree (allocId : AllocId) : MemoryLifecycleError
- immutableAllocation (allocId : AllocId) : MemoryLifecycleError
- memoryKindMismatch (allocId : AllocId) : MemoryLifecycleError
- layoutMismatch (allocId : AllocId) (actualSize requestedSize : ABI.Size) (actualAlign requestedAlign : ABI.Align) : MemoryLifecycleError
- duplicateDeadAllocation (allocId : AllocId) : MemoryLifecycleError
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
Equations
- One or more equations did not get rendered due to their size.
Equations
- One or more equations did not get rendered due to their size.
Equations
- One or more equations did not get rendered due to their size.
Equations
- state.issuedIds = (Miri.Memory.MemoryState.issuedIdTable✝ state).toArray
Instances For
Equations
- state.globals = (Miri.Memory.MemoryState.globalTable✝ state).toArray
Instances For
Equations
Instances For
Equations
- state.extraFnPtrIds = (Miri.Memory.MemoryState.extraFnPtrTable✝ state).toArray
Instances For
Equations
- state.vaListIds = (Miri.Memory.MemoryState.vaListTable✝ state).toArray
Instances For
Equations
Instances For
Equations
Instances For
Equations
- One or more equations did not get rendered due to their size.
Instances For
Equations
- state.hasIssuedId id = (Miri.Memory.MemoryState.issuedIdTable✝ state).contains id.value
Instances For
Equations
- state.hasGlobalId id = (Miri.Memory.MemoryState.globalTable✝ state).contains id.value
Instances For
Equations
- state.hasImportedRuntimeId id = (Miri.Memory.MemoryState.importedGlobalRuntimeTable✝ state).contains id.value
Instances For
Equations
- state.importedGraphIdForRuntime? id = Option.map Prod.snd ((Miri.Memory.MemoryState.importedGlobalRuntimeTable✝ state).find? id.value)
Instances For
Equations
- state.hasExtraFunctionId id = (Miri.Memory.MemoryState.extraFnPtrTable✝ state).contains id.value
Instances For
Equations
- state.hasVaListId id = (Miri.Memory.MemoryState.vaListTable✝ state).contains id.value
Instances For
Equations
- One or more equations did not get rendered due to their size.
Instances For
Replace payloads on every ordered row sharing a runtime allocation ID,
matching mapGlobals semantics while using the certified ID index.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Array-based metadata import for callers constructing a standalone memory state. It preserves duplicate rows and source order while rebuilding the certified lookup index.
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
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
Equations
Instances For
AllocMap::reserve uses an AtomicU64 starting at one and fetch_add.
The returned ID is consumed before later machine hooks run. A zero value
reifies the source's NonZero::new(...).unwrap() exhaustion panic; the state
is marked exhausted so a caller cannot continue after that source-fatal path.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Equations
- state.sourceAllocIdForRuntime? id = Option.map Prod.snd ((Miri.Memory.MemoryState.sourceAllocIdByRuntimeTable✝ state).find? id.value)
Instances For
Equations
- state.runtimeForSourceAllocId? sourceId = Option.map Prod.snd ((Miri.Memory.MemoryState.runtimeBySourceAllocIdTable✝ state).find? sourceId)
Instances For
Equations
- state.findGlobal? id = (Miri.Memory.MemoryState.globalTable✝ state).find? id.value
Instances For
Equations
- state.globalsForId id = (Miri.Memory.MemoryState.globalTable✝ state).valuesFor id.value
Instances For
Equations
- state.runtimeIdForExport? exportId = Option.map Prod.snd ((Miri.Memory.MemoryState.importedGlobalTable✝ state).find? exportId)
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
Equations
- One or more equations did not get rendered due to their size.
Instances For
Source get_alloc_info precedence: local bytes, function values, va-lists,
compiler globals, then dead-allocation metadata. Missing metadata is an
explicit lookup error instead of an unchecked map expectation.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Source get_live_alloc_size_and_align, with both absent metadata and a
dead allocation distinguished explicitly.
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
Exact live write-back from a raw current lookup. This exposes the update without requiring clients to unfold private memory-map helpers.
The upstream provenance collector prunes only dead-allocation metadata in
this part of Memory; live-map and address-map collection have separate
owners.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Raw high-water data and nonzero supplies suffice for the actual allocator reservation. No future allocation/byte/choice operation succeeds by assumption.
- borrowed {Prov Extra : Type} (allocation : Allocation Prov Extra) : AdjustedGlobalAllocation Prov Extra
- owned {Prov Extra : Type} (allocation : Allocation Prov Extra) : AdjustedGlobalAllocation Prov Extra
Instances For
A callback receives the current memory and returns its complete successor, including on failure. This is an ordered state transition, never a map merge between two independently changed memory snapshots.
- memory : MemoryState Prov Extra MachineKind
- state : HookState
Instances For
Compatibility name retained for the global-allocation source interface.
Instances For
- synchronizeMemory : MemoryState Prov Extra MachineKind → HookState → HookState
Install the authoritative memory into any embedded machine view before entering callbacks and after lifecycle-owned cache insertion. Hook states without an embedded memory leave their independent state unchanged.
- evaluateStaticInitializer : MemoryState Prov Extra MachineKind → HookState → Nat → GlobalMemoryHookResult Prov Extra MachineKind HookState Allocation
- beforeAccessGlobal : MemoryState Prov Extra MachineKind → HookState → AllocId → Allocation → Option Nat → Bool → GlobalMemoryHookResult Prov Extra MachineKind HookState Unit
- adjustGlobalAllocation : MemoryState Prov Extra MachineKind → HookState → AllocId → Allocation → GlobalMemoryHookResult Prov Extra MachineKind HookState (AdjustedGlobalAllocation Prov Extra)
Instances For
- memory : MemoryState Prov Extra MachineKind
- hooks : HookState
- outcome : Except GlobalAccessError (AdjustedGlobalAllocation Prov Extra)
Instances For
- memory : MemoryState Prov Extra MachineKind
- hooks : HookState
- outcome : Except MemoryAccessError α
Instances For
- memory : MemoryState Prov Extra MachineKind
- hooks : HookState
- outcome : Except MemoryLifecycleError α
Instances For
The source Memory::deallocate_ptr moves the removed allocation into a
local owner. Preserve that exact owner in the result so machine adapters can
run its drop effects on every post-removal return without inferring ownership
from a map difference.
- memory : MemoryState Prov Extra MachineKind
- hooks : HookState
- detached : Option (AllocId × LocalAllocation Prov Extra MachineKind)
- outcome : Except MemoryLifecycleError Unit
Instances For
Reallocation is allocate-copy-deallocate. When the final deallocation removes its source before returning an error, preserve that exact owner for adapters that must perform allocation-specific drop effects.
- memory : MemoryState Prov Extra MachineKind
- hooks : HookState
- detached : Option (AllocId × LocalAllocation Prov Extra MachineKind)
- outcome : Except MemoryLifecycleError (Pointer Prov)
Instances For
- memory : MemoryState Prov Extra MachineKind
- hooks : HookState
Instances For
Equations
- One or more equations did not get rendered due to their size.
MemoryLifecycleHooks names the machine-dependent portions of rustc's
Machine trait. Every stateful hook returns its updated hook state even when
it fails, so callers can preserve source ordering and side effects. The copy
hook is required for reallocation and must implement the source mem_copy
checks and byte/provenance/initialization transfer; there is no default copy.
- synchronizeMemory : MemoryState Prov Extra MachineKind → HookState → HookState
Keep machine states that embed memory aligned with the explicit authoritative successor at each allocation lifecycle boundary.
- initLocalAllocation : MemoryState Prov Extra MachineKind → HookState → AllocId → MemoryKind MachineKind → ABI.Size → ABI.Align → MemoryStateHookResult Prov Extra MachineKind HookState Extra
- adjustRootPointer : MemoryState Prov Extra MachineKind → HookState → AllocId → MemoryKind MachineKind → MemoryStateHookResult Prov Extra MachineKind HookState (Pointer Prov)
- resolvePointer : MemoryState Prov Extra MachineKind → HookState → Pointer (Option Prov) → Int → PointerResolutionResult Prov Extra MachineKind HookState ProvExtra
- beforeDeallocation : MemoryState Prov Extra MachineKind → HookState → Allocation Prov Extra → Pointer (Option Prov) → AllocId → ProvExtra → ABI.Size → ABI.Align → MemoryKind MachineKind → MemoryStateHookResult Prov Extra MachineKind HookState Unit
- copyMemory : HookState → MemoryState Prov Extra MachineKind → Pointer (Option Prov) → Pointer (Option Prov) → ABI.Size → Bool → Bool → MemoryCopyResult Prov Extra MachineKind HookState
Instances For
Hooks around the allocation-storage part of rustc's mem_copy_repeatedly.
Pointer access and machine callbacks vary between interpreter machines, so
they are explicit inputs. Read/write callbacks return the memory as well as
hook state so mutations to Allocation.extra remain visible if a later stage
fails.
- synchronizeMemory : MemoryState Prov Extra MachineKind → HookState → HookState
Install the authoritative successor in machine states that also contain a memory view before the next callback and in every returned prefix.
- pointerAccess : MemoryState Prov Extra MachineKind → HookState → Pointer (Option Prov) → ABI.Size → MemoryStateHookResult Prov Extra MachineKind HookState (Option (AllocId × ABI.Size × ProvExtra))
- beforeAllocationAccess : MemoryState Prov Extra MachineKind → HookState → AllocId → MemoryStateHookResult Prov Extra MachineKind HookState Unit
- beforeMemoryRead : HookState → MemoryState Prov Extra MachineKind → Allocation Prov Extra → Pointer (Option Prov) → AllocId → ProvExtra → AllocRange → MemoryCopyResult Prov Extra MachineKind HookState
- beforeMemoryWrite : HookState → MemoryState Prov Extra MachineKind → Allocation Prov Extra → Pointer (Option Prov) → AllocId → ProvExtra → AllocRange → MemoryCopyResult Prov Extra MachineKind HookState
Instances For
The deallocation source event uses only resolution and the ordered before-deallocation effect. Allocation/root/copy callbacks are not inputs.
- synchronizeMemory : MemoryState Prov Extra MachineKind → HookState → HookState
- resolvePointer : MemoryState Prov Extra MachineKind → HookState → Pointer (Option Prov) → Int → PointerResolutionResult Prov Extra MachineKind HookState ProvExtra
- beforeDeallocation : MemoryState Prov Extra MachineKind → HookState → Allocation Prov Extra → Pointer (Option Prov) → AllocId → ProvExtra → ABI.Size → ABI.Align → MemoryKind MachineKind → MemoryStateHookResult Prov Extra MachineKind HookState Unit
Instances For
Equations
- hooks.deallocation = { synchronizeMemory := hooks.synchronizeMemory, resolvePointer := hooks.resolvePointer, beforeDeallocation := hooks.beforeDeallocation }
Instances For
Register an imported global by separating its canonical exporter graph ID
from the fresh runtime AllocId assigned by rustc's monotonic supply. This
keeps imported IDs disjoint from later local allocations and makes every
export-ID lookup explicit.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Source get_global_alloc: classify the compiler global, resolve a lazy
static initializer when needed, run before_access_global, then let the
machine convert provenance/bytes/extras. A borrowed conversion remains marked
borrowed so immutable access does not populate the local map.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Source get_alloc_raw: return a local allocation directly. On a global
miss, cache only a machine-owned conversion; a borrowed conversion is returned
without inserting that allocation. All nested callback memory transitions are
retained before the outer cache insertion or any failure is returned.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Source get_alloc_raw_mut: missing globals are adjusted with is_write,
then materialized as MemoryKind::Machine(GLOBAL_KIND) before the mutability
check. Thus an immutable-global error retains the newly cached allocation.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Perform the allocation-storage part of mem_copy_repeatedly after its
caller has resolved pointers and run source/destination access hooks. This
uses Allocation's snapshot-based byte, initialization, and provenance copy.
The source allocation value is captured before the destination update, which
also gives same-allocation copies the source's overlap-safe byte semantics.
The caller remains responsible for the source's pointer-access checks, the
zero-size source/read-hook ordering, before_alloc_access, memory read/write
hooks, and global-allocation lookup. Missing local allocations are explicit
errors; this helper never treats a global or unresolved allocation as an empty
local block. Any destination mutation already made by Allocation before its
error is written back into the memory state.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Source-ordered bridge for Memory::mem_copy_repeatedly. pointerAccess
performs the machine's pointer checks and returns none for a zero-sized
access. The source lookup probe is deliberately after both pointer checks and
before the source read hook; it still runs for zero-sized copies. A zero-sized
source returns after that probe, while a zero-sized destination returns after
the source read hook. The allocation read/write hooks run in source order,
including for repeatCount = 0 when the source range is nonempty.
Once both local allocations are resolved, Allocation.copyRepeatedly handles
the checked destination size, snapshot, initialization/provenance transfer,
overlap assertions, and destination mutations. This method does not synthesize
global allocations: callers must use their global-allocation path or receive
an explicit allocationNotLocal error.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Source Memory::insert_allocation: enforce the object-size bound, reserve
an ID, initialize machine extras, insert into the live map, then adjust the
root pointer.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Source Memory::allocate_ptr: create zeroed backing storage with the
requested initialization mask, then reserve the allocation ID and enter the
insert_allocation transition. The host allocator is a legal-result callback
(none means allocation exhaustion).
Equations
- One or more equations did not get rendered due to their size.
Instances For
Source Memory::deallocate_ptr. The local allocation is removed before
mutability, kind, and layout validation. A failure in those checks or in a
machine hook therefore retains the source's already-removed live-map state.
The Miri machine's address-reuse release occurs inside its deallocation hook,
after borrow/race/synchronization checks, before dead-layout caching.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Compatibility projection for source users that already own the complete allocation lifecycle. Deallocation itself consumes only its two actual hooks.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Source Memory::reallocate_ptr is allocate, copy, deallocate. The
source's mem_copy operation is a required callback because its access,
initialization, provenance, and overlapping-copy semantics are separately
ported by the memory-access layer. Any failure keeps mutations from earlier
steps, including a newly allocated block.
Equations
- One or more equations did not get rendered due to their size.