1
Fork 0

improve volatile comments

This commit is contained in:
Ralf Jung 2018-08-30 17:37:58 +02:00
parent d97f61f10e
commit c06f5517dc

View file

@ -774,8 +774,8 @@ pub unsafe fn write_unaligned<T>(dst: *mut T, src: T) {
/// to not be elided or reordered by the compiler across other volatile /// to not be elided or reordered by the compiler across other volatile
/// operations. /// operations.
/// ///
/// Memory read with `read_volatile` should almost always be written to using /// Memory accessed with `read_volatile` or [`write_volatile`] should not be
/// [`write_volatile`]. /// accessed with non-volatile operations.
/// ///
/// [`write_volatile`]: ./fn.write_volatile.html /// [`write_volatile`]: ./fn.write_volatile.html
/// ///
@ -844,8 +844,8 @@ pub unsafe fn read_volatile<T>(src: *const T) -> T {
/// to not be elided or reordered by the compiler across other volatile /// to not be elided or reordered by the compiler across other volatile
/// operations. /// operations.
/// ///
/// Memory written with `write_volatile` should almost always be read from using /// Memory accessed with [`read_volatile`] or `write_volatile` should not be
/// [`read_volatile`]. /// accessed with non-volatile operations.
/// ///
/// `write_volatile` does not drop the contents of `dst`. This is safe, but it /// `write_volatile` does not drop the contents of `dst`. This is safe, but it
/// could leak allocations or resources, so care should be taken not to overwrite /// could leak allocations or resources, so care should be taken not to overwrite