pub struct PointeeInfo {
pub safe: Option<PointerKind>,
pub size: Size,
pub align: Align,
}
Expand description
Encodes extra information we have about a pointer. Note that this information is advisory only, and backends are free to ignore it: if the information is wrong, that can cause UB, but if the information is absent, that must always be okay.
Fields§
§safe: Option<PointerKind>
If this is None
, then this is a raw pointer, so size and alignment are not guaranteed to
be reliable.
size: Size
If safe
is Some
, then the pointer is either null or dereferenceable for this many bytes.
On a function argument, “dereferenceable” here means “dereferenceable for the entire duration
of this function call”, i.e. it is UB for the memory that this pointer points to to be freed
while this function is still running.
The size can be zero if the pointer is not dereferenceable.
align: Align
If safe
is Some
, then the pointer is aligned as indicated.
Trait Implementations§
Source§impl Clone for PointeeInfo
impl Clone for PointeeInfo
Source§fn clone(&self) -> PointeeInfo
fn clone(&self) -> PointeeInfo
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read more