- Feature Name: volatile
- Start Date: 2016-01-18
- RFC PR: rust-lang/rfcs#1467
- Rust Issue: rust-lang/rust#31756
volatile_store intrinsics as
This is necessary to allow volatile access to memory-mapping I/O in stable code. Currently this is only possible using unstable intrinsics, or by abusing a bug in the
store functions on atomic types which gives them volatile semantics (rust-lang/rust#30962).
ptr::write_volatile will work the same way as
ptr::write respectively, except that the memory access will be done with volatile semantics. The semantics of a volatile access are already pretty well defined by the C standard and by LLVM. In documentation we can refer to http://llvm.org/docs/LangRef.html#volatile-memory-accesses.
We could also stabilize the
volatile_copy_nonoverlapping_memory intrinsics as
ptr::copy_nonoverlapping_volatile, but these are not as widely used and are not available in C.