| MATLAB Application Program Interface | Search  Help Desk |
| mxRealloc | Examples See Also |
C Syntax
#include "matrix.h" #include <stdlib.h> void *mxRealloc(void *ptr, size_t size);
Arguments
ptrmxCalloc, or by a previous call to mxRealloc.
size_t
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.
Example
Seemxsetnzmax.c in the mx subdirectory of the examples directory.
See Also
mxCalloc, mxFree, mxMalloc, mxSetAllocFcns