MCPcopy Index your code
hub / github.com/1Password/zeroizing-alloc / zero

Function zero

src/lib.rs:33–38  ·  view source on GitHub ↗
(ptr: *mut u8, len: usize)

Source from the content-addressed store, hash-verified

31#[cfg(feature = "reference_impl")]
32#[inline]
33unsafe fn zero(ptr: *mut u8, len: usize) {
34 for i in 0..len {
35 core::ptr::write_volatile(ptr.add(i), 0);
36 }
37 core::sync::atomic::compiler_fence(core::sync::atomic::Ordering::SeqCst);
38}
39
40#[cfg(not(feature = "reference_impl"))]
41unsafe fn clear_bytes(ptr: *mut u8, len: usize) {

Callers 1

deallocMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected