Dumps information about objects in the heap from the start of program execution or from a specified heap state (debug version only).

void _CrtMemDumpAllObjectsSince(  
   const _CrtMemState *state  


  • state
    Pointer to the heap state to begin dumping from or NULL.


The _CrtMemDumpAllObjectsSince function dumps the debug header information of objects allocated in the heap in a user-readable form. The dump information can be used by the application to track allocations and detect memory problems. When _DEBUG is not defined, calls to _CrtMemDumpAllObjectsSince are removed during preprocessing.

_CrtMemDumpAllObjectsSince uses the value of the state parameter to determine where to initiate the dump operation. To begin dumping from a specified heap state, the state parameter must be a pointer to a _CrtMemState structure that has been filled in by _CrtMemCheckpoint before _CrtMemDumpAllObjectsSince was called. When state is NULL, the function begins the dump from the start of program execution.

If the application has installed a dump hook function by calling _CrtSetDumpClient, then every time _CrtMemDumpAllObjectsSince dumps information about a _CLIENT_BLOCK type of block, it calls the application-supplied dump function as well. By default, internal C run-time blocks (_CRT_BLOCK) are not included in memory dump operations. The _CrtSetDbgFlag function can be used to turn on the _CRTDBG_CHECK_CRT_DF bit of _crtDbgFlag to include these blocks. In addition, blocks marked as freed or ignored (_FREE_BLOCK, _IGNORE_BLOCK) are not included in the memory dump.

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.



Required header



For more compatibility information, see Compatibility in the Introduction.


Debug versions of C run-time libraries only.


For a sample of how to use _CrtMemDumpAllObjectsSince, see crt_dbg2.

.NET Framework Equivalent

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

See Also


Debug Routines