mexMakeMemoryPersistent (C and Fortran)

Make memory allocated by MATLAB® software persist after MEX-function completes

C Syntax

#include "mex.h"
void mexMakeMemoryPersistent(void *ptr);

Fortran Syntax

mexMakeMemoryPersistent(ptr)
mwPointer ptr

Arguments

ptr

Pointer to the beginning of memory allocated by one of the MATLAB memory allocation routines

Description

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.

See Also

mexAtExit, mexLock, mexMakeArrayPersistent, mxCalloc, mxFree, mxMalloc, mxRealloc

  


 © 1984-2008- The MathWorks, Inc.    -   Site Help   -   Patents   -   Trademarks   -   Privacy Policy   -   Preventing Piracy   -   RSS