Use volatile memory to copy elements from src into self:
(&mut self, src: &[T])
| 200 | |
| 201 | // Use volatile memory to copy elements from src into self: |
| 202 | pub fn cp_from_slice(&mut self, src: &[T]) |
| 203 | where |
| 204 | T: Copy, |
| 205 | R: DerefMut, |
| 206 | { |
| 207 | assert_eq!(self.reference.len(), src.len(), "DEST/SRC SLICES HAVE DIFFERING LENGTHS"); |
| 208 | unsafe |
| 209 | { |
| 210 | intrinsics::volatile_copy_nonoverlapping_memory(self.reference.as_mut_ptr(), src.as_ptr(), self.reference.len()); |
| 211 | } |
| 212 | } |
| 213 | |
| 214 | // Use volatile memmove to copy elements from one part of slice to another part: |
| 215 | pub fn cpinternal(&mut self, src: impl RangeBounds<usize>, dest: usize) |