MATLAB Application Program Interface | Search  Help Desk |
mexMakeMemoryPersistent | See Also |
Make a section of dynamic memory allocated by mxCalloc
persist after the MEX-file completes
#include "mex.h" void mexMakeMemoryPersistent(void *ptr);ptr
mxCalloc
.
By default, memory allocated by mxCalloc
is nonpersistent. That is, MATLAB's memory management facility automatically frees such memory when the MEX-file finishes. Calling mexMakeMemoryPersistent
tells MATLAB not to free such memory when the MEX-file finishes. In other words, the memory allocated by mxCalloc
becomes persistent.
mexLock
, mexMakeArrayPersistent
, mxCalloc