Function libmimalloc_sys::mi_expand
source · pub unsafe extern "C" fn mi_expand(
p: *mut c_void,
newsize: usize,
) -> *mut c_void
Expand description
Try to re-allocate memory to newsize
bytes in place.
Returns null on out-of-memory or if the memory could not be expanded in
place. On success, returns the same pointer as p
.
If newsize
is larger than the original size
allocated for p
, the
bytes after size
are uninitialized.
If null is returned, the original pointer is not freed.
Note: Conceptually, this is a realloc-like which returns null if it
would be forced to reallocate memory and copy. In practice it’s
equivalent testing against mi_usable_size
.