Expand description
The virtual memory representation of the MIR interpreter.
Re-exportsΒ§
use std::alloc;πuse std::alloc::Layout;πuse std::borrow::Cow;πuse std::hash::Hash;πuse std::hash::Hash;πuse std::ops::Deref;πuse std::ops::DerefMut;πuse std::ops::Range;πuse std::fmt;πuse std::hash;πuse std::ptr;πuse either::Left;πuse either::Right;πpub use init_mask::InitChunk;pub use init_mask::InitChunkIter;use rustc_abi::Align;πuse rustc_abi::HasDataLayout;πuse rustc_abi::Size;πuse rustc_ast::Mutability;πuse rustc_data_structures::intern::Interned;πuse rustc_macros::StableHash;πuse rustc_serialize::Decodable;πuse rustc_serialize::Decoder;πuse rustc_serialize::Encodable;πuse rustc_serialize::Encoder;πuse super::AllocId;πuse super::BadBytesAccess;πuse super::CtfeProvenance;πuse super::InterpErrorKind;πuse super::InterpResult;πuse super::Pointer;πuse super::Provenance;πuse super::ResourceExhaustionInfo;πuse super::Scalar;πuse super::UndefinedBehaviorInfo;πuse super::UnsupportedOpInfo;πuse super::interp_ok;πuse super::read_target_uint;πuse super::write_target_uint;πuse crate::ty;πuse init_mask::*;πuse provenance_map::*;π
ModulesΒ§
- init_
mask π - provenance_
map π - Store the provenance for each byte in the range, with a more efficient representation for the common case where PTR_SIZE consecutive bytes have the same provenance.
StructsΒ§
- Alloc
Flags π - Helper struct that packs an alignment, mutability, and βall bytes are zeroβ flag together.
- Alloc
Range - The information that makes up a memory access: offset and size.
- Allocation
- This type represents an Allocation in the Miri/CTFE core engine.
- Const
Allocation - Interned types generally have an
Outertype and anInnertype, whereOuteris a newtype aroundInterned<Inner>, and all the operations are done onOuter, because all occurrences are interned. E.g.Tyis an outer type andTyKindis its inner type.
EnumsΒ§
- Alloc
Error - We have our own error type that does not know about the
AllocId; that information is added when converting toInterpError. - Alloc
Init - Whether a new allocation should be initialized with zero-bytes.
ConstantsΒ§
- MAX_
BYTES_ πTO_ HASH - This is the maximum size we will hash at a time, when interning an
Allocationand itsInitMask. Note, we hash that amount of bytes twice: at the start, and at the end of a buffer. Used when these two structures are large: we only partially hash the larger fields in that situation. See the comment at the top of their respectiveHashimpl for more details. - MAX_
HASHED_ πBUFFER_ LEN - This is the maximum size (in bytes) for which a buffer will be fully hashed, when interning.
Otherwise, it will be partially hashed in 2 slices, requiring at least 2
MAX_BYTES_TO_HASHbytes.
TraitsΒ§
- Alloc
Bytes - Functionality required for the bytes of an
Allocation.
FunctionsΒ§
- all_
zero π - Efficiently detect whether a slice of
u8is all zero. - alloc_
range - Free-starting constructor for less syntactic overhead.