(dst: &mut [T], src: T)
| 19 | /// Fill a slice using an assembly optimization barrier or portable volatile writes. |
| 20 | #[inline] |
| 21 | pub(crate) fn fill_slice<T: Copy>(dst: &mut [T], src: T) { |
| 22 | if size_of::<T>() == 0 { |
| 23 | return; |
| 24 | } |
| 25 | |
| 26 | if HAS_ASM { |
| 27 | dst.fill(src); |
| 28 | optimization_barrier(dst); |
| 29 | } else { |
| 30 | volatile_fill_slice(dst, src); |
| 31 | } |
| 32 | } |
| 33 | |
| 34 | /// Zero bytes which may be uninitialized, including padding. |
| 35 | /// |
no test coverage detected