File tree Expand file tree Collapse file tree 1 file changed +7
-4
lines changed Expand file tree Collapse file tree 1 file changed +7
-4
lines changed Original file line number Diff line number Diff line change 16
16
//! doing with that hunk of memory.
17
17
//!
18
18
//! For the purposes of maintaining safety, volatile memory has some rules of its own:
19
+ //!
19
20
//! 1. No references or slices to volatile memory (`&` or `&mut`).
21
+ //!
20
22
//! 2. Access should always been done with a volatile read or write.
21
- //! The First rule is because having references of any kind to memory considered volatile would
22
- //! violate pointer aliasing. The second is because unvolatile accesses are inherently undefined if
23
- //! done concurrently without synchronization. With volatile access we know that the compiler has
24
- //! not reordered or elided the access.
23
+ //!
24
+ //! The First rule is because having references of any kind to memory considered volatile would
25
+ //! violate pointer aliasing. The second is because unvolatile accesses are inherently undefined if
26
+ //! done concurrently without synchronization. With volatile access we know that the compiler has
27
+ //! not reordered or elided the access.
25
28
26
29
use std:: cmp:: min;
27
30
use std:: io:: { self , Read , Write } ;
You can’t perform that action at this time.
0 commit comments