MATLAB Application Program Interface Reference Help Desk

mxRealloc

Purpose

Reallocate memory

C Syntax

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:

Note: This will cause memory leaks if mxRealloc fails and returns NULL.

See Also

mxCalloc, mxFree, mxSetAllocFcns



[ Previous | Help Desk | Next ]