Reallocates a chunk of bytes.
unsafe fn reallocate_raw(pool: &mut <Self as Allocator>::Pool, ptr: *mut u8, oldsize: usize, newsize: usize, alignment: usize) -> Result<*mut u8, Errno>
| Name | Description |
|---|---|
| pool | The pool from which to draw memory. |
| ptr | The pointer that should be reallocated. |
| oldsize | The previous size of the allocation. |
| newsize | The new size. |
| alignment | The alignment of the allocation. |
Returns the new object.
The pointer argument must have been returned by a previous invocation of allocate_raw or reallocate_raw with the same allocator and pool. The alignment argument must be the same alignment that was previously used to allocate the object. The oldsize argument must be the current size of the object.
Otherwise the behavior is undefined.
If this function returns successfully, the pointer argument becomes invalid and must no longer be used. Otherwise the pointer argument can continued to be used.
If the function returns successfully, the first oldsize bytes in the new object are the same as the first oldsize bytes in the old object.
If newsize is 0, the behavior is undefined.