Reallocate memory
C Syntax
#include "matrix.h"
#include <stdlib.h>
void *mxRealloc(void *ptr, size_t size);
Arguments
ptr
Pointer to a block of memory allocated by mxCalloc, or by a previous call to mxRealloc.
size_t
New size of allocated memory, in bytes.
Description
mxRealloc reallocates the memory routine for the managed list. If mxRealloc fails to allocate a block, you must free the block since the ANSI definition of realloc states that the block remains allocated. mxRealloc returns NULL in this case, and in subsequent calls to mxRealloc of the form:
x = mxRealloc(x, size);
Note: This will cause memory leaks if mxRealloc fails and returns NULL.
See Also
mxCalloc, mxFree, mxMalloc, mxSetAllocFcns
[ Previous | Help Desk | Next ]