Skip to main content

realloc

Function realloc 

Source
pub unsafe fn realloc(
    ptr: *mut u8,
    layout: Layout,
    new_size: usize,
) -> Option<NonNull<u8>>
Expand description

Fallible reallocation matching standard alloc interface.

ยงSafety

  • ptr is allocated via this allocator,
  • layout is the same layout that was used to allocate that block of memory,
  • new_size is greater than zero,
  • new_size, when rounded up to the nearest multiple of layout.align(), does not overflow isize.