Verifies that the heap contains the specified pointer (debug version only).
int _CrtIsValidHeapPointer ( const void * _HeapPtr );
_HeapPtr
Use _CrtIsValidHeapPointer to ensure that a specific memory address is within the heap. When _DEBUG is not defined, preprocessing removes calls to _CrtIsValidHeapPointer.
Because this function returns TRUE or FALSE, you can pass it to one of the _ASSERT macros to create a simple debugging error handling mechanism. The following example causes an assertion failure if the specified address is not located within the local heap:
_ASSERTE( _CrtIsValidHeapPointer( userData ) );
For more information about how to use _CrtIsValidHeapPointer with other debug functions and macros, see Using Macros for Verification and Reporting. 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.
EINVAL |
_HeapPtr is invalid. |
Versions | Defined in | Include | Link to |
---|---|---|---|
INtime 3.13 | intime/rt/include/crtdbg.h | crtdbg.h | clib.lib |