This lists common operations related to heap management and the RT kernel system calls that do the operations:
| To . . . | Use this system call . . . |
|---|---|
| Confirm the integrity of the memory blocks allocated in the debug heap | _CrtCheckMemory |
| Generate a report with a debug message and send the report to three possible destinations | _CrtDbgReport |
| Call an application-supplied function for all _CLIENT_BLOCK types in the heap | _CrtDoForAllClientObjects |
| Dump all the memory blocks in the debug heap when a memory leak occurs | _CrtDumpMemoryLeaks |
| Retrieve the current client-defined allocation function for hooking into the C runtime debug memory allocation process | _CrtGetAllocHook |
| Retrieve the current application-defined function for dumping the _CLIENT_BLOCK type memory blocks | _CrtGetDumpClient |
| Retrieve the client-defined reporting function for hooking it into the C runtime library for the debug reporting process | _CrtGetReportHook |
| Verify that a specified memory block is in the local heap and that it has a valid debug heap block type identifier | _CrtIsMemoryBlock |
| Verify that the local heap contains the specified pointer | _CrtIsValidHeapPointer |
| Obtain the debug heap's current state and store it in an application-supplied _CrtMemState structure | _CrtMemCheckpoint |
| Compare two memory states and return their difference | _CrtMemDifference |
| Dump information about objects in the heap from the start of program execution or from a specified heap state | _CrtMemDumpAllObjectsSince |
| Dump the debug header information for a specified heap state in a user-readable form | _CrtMemDumpStatistics |
| Return the block type/subtype associated with a given debug heap block pointer | _CrtReportBlockType |
| Install a client-defined allocation function by hooking it into the C runtime debug memory allocation process | _CrtSetAllocHook |
| Set a breakpoint on a specified object allocation order number | _CrtSetBreakAlloc |
| Retrieve or modify the _crtDbgFlag flag state to control the debug heap manager's allocation behavior | _CrtSetDbgFlag |
| Install an application-defined function to dump _CLIENT_BLOCK type memory blocks | _CrtSetDumpClient |
| Specify the file handle to receive the message text after specifying _CRTDBG_MODE_FILE with _CrtSetReportMode | _CrtSetReportFile |
| Install a client-defined reporting function by hooking it into the C runtime debug reporting process | _CrtSetReportHook |
| Specify the destination(s) for a specific report type generated by _CrtDbgReport and any macros that call _CrtDbgReport or _CrtDbgReportW | _CrtSetReportMode |
| Add a new chunk to the heap. | heap_add_chunk |
| Return the current number of buffers created by calloc, malloc, or realloc | heap_buffer_cnt |
| Report the size of a buffer returned by calloc, malloc, or realloc | heap_buffer_size |
| Check the heap for internal consistency | heap_check |
| Return memory pages released (via free) and no longer in use | heap_compact |
| Dump heap statistics and list to the console or to a file | heap_dump |
| Get the basic heap allocation block's size | heap_get_blk_size |
| Get the heap's configuration | heap_get_config |
| Return the system page size | heap_get_page_size |
| Set the basic heap allocation block's size | heap_set_blk_size |
| Set the specified heap's configuration | heap_set_config |
| Get the heap's statistics | heap_stats |
| Reset the heap's statistics | heap_stats_reset |
| Determine whether the buffer address is valid and exists within the heap | heap_validate_buffer |
| Instruct the heap manager to clear all buffers when freed | heap_zap |
| Add a new memory chunk to a memory pool | mpool_add_chunk |
| Allocate a new buffer from a memory pool | mpool_alloc |
| Return the current number of buffers created by mpool_alloc or mpool_realloc | mpool_buffer_cnt |
| Return the size of a buffer returned by mpool_alloc or mpool_realloc | mpool_buffer_size |
| Check the memory pool for internal consistency | mpool_check |
| Return to the operating system pages of memory freed via mpool_free and no longer in use | mpool_compact |
| Create a memory pool and return a handle to it | mpool_create |
| Delete a memory pool and free all its resources | mpool_delete |
| Dump memory pool statistics and list to the console or a file | mpool_dump |
| Free a buffer allocated with mpool_alloc or mpool_realloc | mpool_free |
| Get the configuration for a pool | mpool_get_config |
| Retrieve the name associated with a pool | mpool_pool2name |
| Retrieve the pool associated with a buffer | mpool_ptr2pool |
| Change the size of a buffer allocated with mpool_alloc or mpool_realloc | mpool_realloc |
| Restore a pool to its creation state | mpool_reset |
| Set the configuration for a pool | mpool_set_config |
| Get the statistics for a memory pool | mpool_stats |
| Reset the statistics for a memory pool | mpool_stats_reset |
| Determine whether the buffer address is valid and exists within a pool buffer | mpool_validate_buffer |