MATLAB Application Program Interface Reference | Help Desk |
mxRealloc
Reallocate memory
#include "matrix.h" #include <stdlib.h> void *mxRealloc(void *ptr, size_t size);ptr
Pointer to a block of memory allocated by mxCalloc
, or by a previous call to mxRealloc
.
New size of allocated memory, in bytes.
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
.
mxCalloc
, mxFree
, mxSetAllocFcns