Function dealloc

Source
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

  • ptr must have been returned by a previous call to alloc or alloc_zeroed with the same layout and scrap heap.
  • Using an invalid pointer or mismatched layout may cause undefined behavior.