[][src]Function snmalloc_sys::rust_realloc

pub unsafe extern "C" fn rust_realloc(
    ptr: *mut c_void,
    alignment: size_t,
    old_size: size_t,
    new_size: size_t
) -> *mut c_void

Re-allocate the memory at the given address with the given alignment and size. On success, it returns a pointer pointing to the required memory address. The memory content within the new_size will remains the same as previous. On failure, it returns a null pointer. In this situation, the previous memory is not returned to the allocator. The client must assure the following things:

  • the memory is acquired using the same allocator and the pointer points to the start position
  • alignment and old_size is the same as allocation
  • alignment fulfills all the requirements as rust_alloc The program may be forced to abort if the constrains are not full-filled.