pub struct Allocation<'ctx, 'tcx> {
pub base: Int<'ctx>,
pub size: Int<'ctx>,
pub align: u64,
pub element_ty: Option<Ty<'tcx>>,
pub is_external: bool,
pub dead: bool,
pub initialized: bool,
pub alive_assumed: bool,
pub nul_terminated: bool,
pub parent: Option<AllocId>,
pub slice_data: Option<AllocId>,
}Expand description
A memory allocation (stack or heap).
The allocation is stored in VmState::allocations at index AllocId.0
(an AllocId is a monotonic counter that doubles as the vector index).
Fields§
§base: Int<'ctx>Base address (fresh Z3 constant).
size: Int<'ctx>Size in bytes (Z3 term, may be symbolic).
align: u64Alignment in bytes.
element_ty: Option<Ty<'tcx>>Element type for bounds checking.
is_external: boolTrue if this allocation models an external raw-pointer parameter whose exact size and nullability are unknown.
dead: boolAllocations that have been freed (StorageDead, Drop).
initialized: boolAllocations that have been written to (initialized via write/MaybeUninit).
alive_assumed: boolAllocations assumed alive via contract (e.g. #[rapx::requires(Alive(ptr))]).
nul_terminated: boolAllocations known to be a null-terminated byte buffer (a valid C
string), asserted via a ValidCStr contract fact or struct invariant.
parent: Option<AllocId>Parent allocation for sub-allocations created by split_at / from_raw_parts.
slice_data: Option<AllocId>Slice data allocation: for a &[T] reference’s stack allocation, the
symbolic data allocation created for the slice contents.
Trait Implementations§
Source§impl<'ctx, 'tcx> Clone for Allocation<'ctx, 'tcx>
impl<'ctx, 'tcx> Clone for Allocation<'ctx, 'tcx>
Source§fn clone(&self) -> Allocation<'ctx, 'tcx>
fn clone(&self) -> Allocation<'ctx, 'tcx>
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreAuto Trait Implementations§
impl<'ctx, 'tcx> !DynSend for Allocation<'ctx, 'tcx>
impl<'ctx, 'tcx> !DynSync for Allocation<'ctx, 'tcx>
impl<'ctx, 'tcx> !RefUnwindSafe for Allocation<'ctx, 'tcx>
impl<'ctx, 'tcx> !Send for Allocation<'ctx, 'tcx>
impl<'ctx, 'tcx> !Sync for Allocation<'ctx, 'tcx>
impl<'ctx, 'tcx> !UnwindSafe for Allocation<'ctx, 'tcx>
impl<'ctx, 'tcx> Freeze for Allocation<'ctx, 'tcx>
impl<'ctx, 'tcx> Unpin for Allocation<'ctx, 'tcx>
impl<'ctx, 'tcx> UnsafeUnpin for Allocation<'ctx, 'tcx>
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more