|Important||This document may not represent best practices for current development, links to downloads and other resources may no longer be valid. Current recommended version can be found here. ArchiveDisclaimer|
Obtains the current state of the debug heap and stores in an application-supplied _CrtMemState structure (debug version only).
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. This snapshot can be used by other heap state functions to help detect memory leaks and other problems. Whenis 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. For more information about how memory blocks are allocated, initialized, and managed in the debug version of the base heap, see .
If state is NULL, the invalid parameter handler is invoked, as described in . If execution is allowed to continue, is set to EINVAL and the function returns.
Windows 95, Windows 98, Windows 98 Second Edition, Windows Millennium Edition, Windows Millennium Edition, Windows NT 4.0, Windows 2000, Windows XP Home Edition, Windows XP Professional, Windows Server 2003
For more compatibility information, seein the Introduction.
Libraries: Debug versions ofonly.