(ptr: *mut u8, len: usize)
| 39 | |
| 40 | #[cfg(not(feature = "reference_impl"))] |
| 41 | unsafe fn clear_bytes(ptr: *mut u8, len: usize) { |
| 42 | // We expect this to optimize into a `memset` for performance. Due to this function only being used via `read_volatile`, |
| 43 | // the compiler doesn't know that the slice this function will be wiping is about to be destroyed anyway. |
| 44 | // |
| 45 | // SAFETY: The caller must only pass a valid allocated object. |
| 46 | ptr.write_bytes(0x0, len); |
| 47 | } |
| 48 | |
| 49 | // This is meant to avoid compiler optimizations while still retaining performance. |
| 50 | // |
nothing calls this directly
no outgoing calls
no test coverage detected