This documentation is archived and is not being maintained.


Obtains the current state of the debug heap and stores in an application-supplied _CrtMemState structure (debug version only).

void _CrtMemCheckpoint(
   _CrtMemState *state 


Pointer to _CrtMemState structure to fill with the memory checkpoint.


The _CrtMemCheckpoint function creates a snapshot of the current state of the debug heap at any given moment, which can be used by other heap state functions to help detect memory leaks and other problems. When _DEBUG is not defined, calls to _CrtMemState are removed during preprocessing.

The application must pass a pointer to a previously allocated instance of the _CrtMemState structure, defined in CRTDBG.H, in the state parameter. If _CrtMemCheckpoint encounters an error during the checkpoint creation, the function generates a _CRT_WARN debug report describing the problem.

For more information about heap state functions and the _CrtMemState structure, see Heap State Reporting Functions. For information about how memory blocks are allocated, initialized, and managed in the debug version of the base heap, see Memory Management and the Debug Heap.


Routine Required header Compatibility
_CrtMemCheckpoint <crtdbg.h> Win 98, Win Me, Win NT, Win 2000, Win XP

For additional compatibility information, see Compatibility in the Introduction.


Debug versions of C run-time libraries only.


For a sample of how to use _CrtMemCheckpoint, see crt_dbg1.

See Also

Debug Functions | Run-Time Routines and .NET Framework Equivalents