Function loom::alloc::dealloc

source ·
pub unsafe fn dealloc(ptr: *mut u8, layout: Layout)
Expand description

Deallocate memory with the global allocator.

This is equivalent to the standard library’s std::alloc::dealloc, but with the addition of leak tracking for allocated objects. Loom’s leak tracking may report false positives if allocations allocated with loom::alloc::alloc or loom::alloc::alloc_zeroed are deallocated via std::alloc::dealloc rather than by this function.

This function forwards calls to the GlobalAlloc::dealloc method of the allocator registered with the #[global_allocator] attribute if there is one, or the std crate’s default.

§Safety

See GlobalAlloc::dealloc.