OpenDOF Project
void* DOFMem_Realloc ( void *  mem,
uint32  size 
)

Reallocate a block of memory.

The block must have been allocated previously by DOFMem_Alloc. When successful, the block of memory passed in must no longer be referenced or freed; instead, the return value represents a new block of the new size. It is possible, but not guaranteed in any circumstance, that the returned block may have the same pointer value as the original block. If the call is unsuccessful, NULL is returned and the original block is left untouched (and must still be freed).

The data contents of the original block are copied/moved to the new block, up to either the given size or the size of the original block, whichever is smaller.

It is assumed that reallocating to the same or smaller size will always succeed.

Parameters
memThe block of memory. This must not be NULL.
sizeThe new size of the allocated memory block. It may be larger or smaller than the original allocated size. This must be greater than 0.
Returns
A pointer to the new block of memory of the specified size, or NULL if the request could not be satisfied.
core-c-dof-oal Version 8.0.1 Build 0
2018-01-22