Please enable JavaScript to view this site.

Memory Validator Help

Navigation: Native API

Utility Functions

Scroll Prev Top Next More

 

API utility functions

 

The API utility functions provide access to a few tools such as

 

 

Dumping leaked objects to a callback or a data file
 

Force a garbage collection on the C runtime heap

 

Running an integrity check on the C runtime heap
 

Shutting down Memory Validator

 

 

mvUserDumpLeaks()

 

Dumps any leaked memory objects to the specified callback, or to a data file, depending on the dumpMethod parameter.

 

extern "C" 
DUMP_RESULT mvUserDumpLeaks(DUMP_METHOD        dumpMethod, // how to do the dump DUMP_TO_FILE_HOST, DUMP_TO_FILE_REMOTE, or DUMP_TO_CALLBACK
                            const TCHAR*       fileName,   // NULL if no file,
                            USER_DUMP_CALLBACK callback,   // NULL if not to callback
                            DWORD              userData);  // userdata to pass to callback

 

 

mvGarbageCollect()

 

Forces garbage collection to be performed on the C runtime heap.

 

This facility is useful to allow cleanup after a function has leaked and would like to start from a known state of 'not leaked'.

 

noteUse with caution. Memory Validator is not designed to be used as a garbage collector, and this function is not very efficient. It can take a long time to execute if there are lots of allocations.

 

extern "C" 
int mvGarbageCollect();

 

 

mvIntegrityCheck()

 

Perform an integrity check on the C runtime heap.

 

extern "C" 
int mvIntegrityCheck();  // Returns TRUE or FALSE depending on whether the check passed

 

 

mvShutdownMemoryValidator()

 

Call from your target application to turn off Memory Validator functionality.

 

extern "C" 
int mvShutdownMemoryValidator();