MCPcopy Create free account
hub / github.com/RustCrypto/utils / dealloc

Method dealloc

zeroize/tests/alloc.rs:23–33  ·  view source on GitHub ↗
(&self, ptr: *mut u8, layout: Layout)

Source from the content-addressed store, hash-verified

21 }
22
23 unsafe fn dealloc(&self, ptr: *mut u8, layout: Layout) {
24 if ptr == REG_PTR.load(Relaxed) {
25 for i in 0..layout.size() {
26 let b = unsafe { ptr::read(ptr.add(i)) };
27 assert_eq!(b, 0);
28 }
29 REG_PTR.store(ptr::null_mut(), Relaxed);
30 }
31
32 unsafe { System.dealloc(ptr, layout) }
33 }
34}
35
36#[global_allocator]

Callers

nothing calls this directly

Calls 1

sizeMethod · 0.45

Tested by

no test coverage detected