C++ Math Library Reference    
mwSetLibraryAllocFcns

Set memory management functions for MATLAB C++ Math Library

C++ Prototype

Arguments
callocProc
   A pointer to a function that allocates memory. mwMemCallocFunc is defined as:

freeProc
   A pointer to a function that frees memory. mwMemFreeFunc is defined as:

reallocProc
   A pointer to a function that reallocates memory. mwMemReallocFunc is defined as:

mallocproc
   A pointer to a function that allocates memory. mwMemAllocFunc is defined as:

compactproc
   Not currently used.

Description

Sets the MATLAB C++ Math Library's memory management functions. Gives you complete control over memory management.

To set up your own memory management routines, you need to write four routines: two memory allocation routines, one memory reallocation routine, and one deallocation routine. You then call mwSetLibraryAllocFcns() to register those routines with the library.

You cannot omit any of the four routines. However, the last argument to mwSetLibraryAllocFcns(), mwMemCompactFunc, is not currently used and is therefore initialized to zero. When you call mwSetLibraryAllocFcns(), you do not need to specify a value for it.


 mwSetExceptionMsgHandler mwSetPrintHandler