Skip to main content

read_volatile_wrapper

Function read_volatile_wrapper 

Source
pub unsafe exec fn read_volatile_wrapper<T>(ptr: *const T) -> ret : T
Expand description
with
Ghost(is_rust_allocation): Ghost<bool>,
Tracked(perm): Tracked<Option<&mut PointsTo<T>>>,
requires
ptr.addr() % align_of::<T>() == 0,
is_rust_allocation
    ==> (perm matches Some(
        p,
    ) && {
        &&& p.ptr() == ptr
        &&& p.is_init()

    }),
!is_rust_allocation ==> perm is None,
ensures
is_rust_allocation
    ==> (perm matches Some(
        p,
    ) && {
        &&& final(p).ptr() == ptr
        &&& final(p).is_uninit()
        &&& ret == p.value()

    }),

Volatile read with optional Rust allocation permission.

§Safety

Classify the pointer correctly and uphold core::ptr::read_volatile’s requirements.