| Contents | Index |
#include "mex.h" void mexMakeMemoryPersistent(void *ptr);
subroutine mexMakeMemoryPersistent(ptr) mwPointer ptr
By default, memory allocated by MATLAB software is nonpersistent, so it is freed automatically when the MEX-function finishes. If you want the memory to persist, you must call mexMakeMemoryPersistent.
Note If you create persistent memory, you are responsible for freeing it when the MEX-function is cleared. If you do not free the memory, MATLAB leaks memory. To free memory, use mxFree. See mexAtExit to see how to register a function that gets called when the MEX-function is cleared. See mexLock to see how to lock your MEX-function so that it is never cleared. |
mexAtExit, mexLock, mexMakeArrayPersistent, mxCalloc, mxFree, mxMalloc, mxRealloc

Includes the most popular MATLAB recorded presentations with Q&A sessions led by MATLAB experts.
| © 1984-2012- The MathWorks, Inc. - Site Help - Patents - Trademarks - Privacy Policy - Preventing Piracy - RSS |