Function bitflags::__core::ptr::write_volatile [] [src]

pub unsafe fn write_volatile<T>(dst: *mut T, src: T)
Unstable (volatile)

: recently added

Performs a volatile write of a memory location with the given value without reading or dropping the old value.

Volatile operations are intended to act on I/O memory, and are guaranteed to not be elided or reordered by the compiler across other volatile operations. See the LLVM documentation on [volatile].

Safety

This operation is marked unsafe because it accepts a raw pointer.

It does not drop the contents of dst. This is safe, but it could leak allocations or resources, so care must be taken not to overwrite an object that should be dropped.

This is appropriate for initializing uninitialized memory, or overwriting memory that has previously been read from.