relloc

Function relloc 

Source
pub fn relloc(
    ptr: *mut u8,
    new_size: usize,
) -> Result<*mut u8, ReallocationError>
Expand description

Reallocates memory allocated by alloc.

ยงErrors

  • AllocationError if alloc() fails
  • DeallocationError if free(ptr) fails
  • FreeFailedTwice if free(ptr) fails and freeing the newly allocate pointer also fails
  • ImproperAlignment if ptr is not properly aligned
  • InvalidPointer if ptr was not allocated by alloc or is invalid
  • UseAfterFree if you try to realloc a freed pointer