pub unsafe fn realloc(
ptr: *mut u8,
new_size: usize,
) -> Result<*mut u8, ReallocationError>Expand description
Reallocates memory allocated by crate::alloc.
§Errors
AllocationErroris returned if the call tocrate::allocfails.DeallocationErroris returned if the call tocrate::freefails.ImproperAlignmentis returned if the pointer provided was not aligned properly.MarkerFreeis returned ifptrwas previously freed or reallocated.MarkerCorruptedis returned if the marker is neither free nor used, which generally signals memory corruption, or the passing of a pointer not allocated bycrate::alloc.NewAllocationFailedis returned if allocating the new memory buffer fails. This is the only error which is fully recoverable, as your current allocation remains valid.
§Safety
See crate::free for safety information.