Was this page helpful?
Your feedback about this content is important. Let us know what you think.
Additional feedback?
1500 characters remaining
Export (0) Print
Expand All
div
eof
Expand Minimize
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.

_CrtMemCheckpoint

Updated: May 2009

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

void _CrtMemCheckpoint(
   _CrtMemState *state 
);

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. This snapshot can be used by other heap state functions such as _CrtMemCheckpoint 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 more 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.

If state is NULL, the invalid parameter handler is invoked, as described in Parameter Validation. If execution is allowed to continue, errno, _doserrno, _sys_errlist, and _sys_nerr is set to EINVAL and the function returns.

Routine

Required header

_CrtMemCheckpoint

<crtdbg.h>, <errno.h>

For more compatibility information, see Compatibility in the Introduction.

Libraries: Debug versions of C Run-Time Libraries only.

Not applicable. To call the standard C function, use PInvoke. For more information, see Platform Invoke Examples.

Date

History

Reason

May 2009

Added references to _CrtMemDifference.

Information enhancement.

Community Additions

ADD
Show:
© 2015 Microsoft