Function libmimalloc_sys::mi_free_size

source ·
pub unsafe extern "C" fn mi_free_size(p: *mut c_void, size: usize)
Expand description

Size-aware deallocation: Like mi_free, but accepts the size and alignment as well.

Note: unlike some allocators that require this information for performance, mimalloc doesn’t need it (as of the current version, v2.0.0), and so it currently implements this as a (debug) assertion that verifies that p is actually aligned to alignment and is usable for at least size bytes, before delegating to mi_free.

However, currently there’s no way to have this crate enable mimalloc’s debug assertions, so these checks aren’t particularly useful.

Note: It’s legal to pass null to this function.