Contents, API Reference, Interfaces, iAllocator, expand
Expands a previously allocated memory block, either in place (with heap modification as in system realloc) or
by allocating a new, larger block and copying data.
void* expand(void* oldPtr, uint32_t oldSize, uint32_t oldSize_Used, uint32_t newSize);
Pointer to memory block to expand (guaranteed non-zero).
The current size of the memory block (in bytes, guaranteed non-zero).
The amount of data actually used at the start of the memory block (in bytes, guaranteed less than or equal to oldSize).
The desired size of the memory block to be allocated (in bytes, guaranteed to be larger than oldSize).
This method is designed to be implemented either by:
- calling through to the underlying system realloc() method, or
- manually allocating a new block, copying data across to the new block (e.g. with memcpy()) and then freeing the old block