pub unsafe fn dealloc(
scrap_heap: NonNull<ScrapHeap>,
ptr: NonNull<u8>,
layout: Layout,
)Expand description
Deallocates memory previously allocated using alloc or alloc_zeroed with the same scrap heap.
ยงSafety
ptrmust have been returned by a previous call toallocoralloc_zeroedwith the same layout and scrap heap.- Using an invalid pointer or mismatched layout may cause undefined behavior.