CVIDynamicMemoryInfo
int CVIDynamicMemoryInfo (const char message[], size_t *allocatedBlocks, size_t *allocatedBytes, unsigned int options);
Purpose
Returns information about dynamic memory allocated by the following ANSI C library functions: malloc, calloc and realloc. The function does not return information about the memory allocated internally in the CVI Run-time Engine.
CVIDynamicMemoryInfo determines the total number of memory blocks allocated and the total number of bytes allocated.
In addition, the function can display this information and additional information for each individual memory block in the debug output window.
Consider enabling resource trackingenabling resource tracking if you want to examine dynamic memory and other types of allocated and released resources. Resource tracking is available only in the LabWindows/CVI Full Development SystemLabWindows/CVI Full Development System.
Parameters
Input | ||
Name | Type | Description |
message | const char [] | A custom message that appears alongside the memory information in the debug output window. This message helps associate a memory dump with the corresponding location in the source code. |
options | unsigned int | Options to customize the behavior of CVIDynamicMemoryInfo. Currently, the following options are supported: DYNAMIC_MEMORY_SHOW_ALLOCATED_MEMORY—Displays size and content (the first few bytes) of individual memory blocks in the debug output window. DYNAMIC_MEMORY_SHOW_ALLOCATED_MEMORY_SUMMARY—Lists total number and size of all allocated memory blocks in the debug output window. |
Output | ||
Name | Type | Description |
allocatedBlocks | size_t | Contains the total number of allocated memory blocks when the function returns. allocatedBlocks can be NULL. |
allocatedBytes | size_t | Contains the total number of bytes allocated in all memory blocks. allocatedBytess can be NULL. |
Return Value
Name | Type | Description |
result | int | The return value of this function. CVIDynamicMemoryInfo returns 0 if it completed successfully. |
Additional Information
Library: Utility Library
Include file: utility.h
LabWindows/CVI compatibility: LabWindows/CVI 6.0 and later