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 1616//! doing with that hunk of memory.
1717//!
1818//! For the purposes of maintaining safety, volatile memory has some rules of its own:
19+ //!
1920//! 1. No references or slices to volatile memory (`&` or `&mut`).
21+ //!
2022//! 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.
2528
2629use std:: cmp:: min;
2730use std:: io:: { self , Read , Write } ;
You can’t perform that action at this time.
0 commit comments