Reallocates an array.
unsafe fn reallocate_array<T>(pool: &mut <Self as Allocator>::Pool, ptr: *mut T, oldnum: usize, newnum: usize) -> Result<*mut T, Errno>
| Name | Description |
|---|---|
| pool | The pool from which to draw memory. |
| ptr | The pointer that should be reallocated. |
| oldnum | |
| newnum | The new number of elements in the array. |
Returns a pointer to the new array.
If T has size 0, a call to this function behaves like a call to empty_ptr. Otherwise:
The pointer argument must be a pointer returned by a previous call to allocate_array or reallocate_array with the same allocator and pool. The oldnum argument must be the number of elements pointed to by the pointer argument.
Otherwise the behavior is undefined.
If newnum is 0, the behavior is undefined.
If this function returns successfully, the old pointer becomes invalid and must no longer be used. Otherwise the old pointer can continued to be used.