Skip to main content

write_volatile_wrapper

Function write_volatile_wrapper 

Source
pub unsafe exec fn write_volatile_wrapper<T>(ptr: *mut T, value: 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),
!is_rust_allocation ==> perm is None,
ensures
is_rust_allocation
    ==> (perm matches Some(
        p,
    ) && {
        &&& final(p).ptr() == ptr
        &&& final(p).opt_value() == MemContents::Init(value)

    }),

Volatile write with optional Rust allocation permission.

§Safety

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