Please enable JavaScript to view this site.

Memory Validator Help

The Heap tab allows you to choose how Win32 Heaps are managed.

 

The picture below shows the default settings:

 

heap-settings

 

 

Checking for damaged memory before HeapReAlloc / HeapFree

 

Memory Validator can run background checks on the input pointers to HeapReAlloc() and HeapFree() for validity and report any errors.

 

Enable checks on HeapReAlloc and HeapFree instructionStep enables detection (off by default)

 

 When this is enabled you may wish to prevent those functions from being called when an invalid pointer is detected.

 

Don't call function when error detected instructionStep prevent Win32 heap checking breakpoints from being triggered when an error is detected

 
The reason you might not want to call the functions is that the Win32 heap checking code will force a debugger breakpoint instruction to be executed, which will either terminate your program or start a debugger to attach to the program. Avoiding these heap checks when Memory Validator already knows about the error will prevent the program run from being interrupted by a breakpoint.

 

 

How to handle non-deallocated memory when you destroy a Win32 heap using HeapDestroy

 

Memory Validator can interpret the call to HeapDestroy() in two ways.

 

 

Mark all non-deallocated memory as deallocted. instructionStep use this if you are ignoring calls to HeapFree() because you will be calling HeapDestroy() at the end of the function. An example use case would be implementing a linear heap.

 

 

Mark all non-deallocated memory as leaked. instructionStep use this if you are using Win32 heaps as the backing store for your own memory allocator.

 

 

The default option is to mark non-deallocated memory as leaked as this is the most common usage pattern.

 

 

Ignoring CRT calls after detecting damaged memory

 

Memory Validator inspects the memory pointers passed to realloc(), _expand(), free(), delete and delete [].

 

Any damage to the part of the heap that contains the memory pointer is reported, and normally, the intended CRT function call is ignored to prevent the application from the typically resulting crash.

 

Call the CRT function... instructionStep allows the CRT function call to proceed anyway even if damaged memory has been detected (switched off by default)

 

 

Reset All - Resets all global settings, not just those on the current page.

 

 

Reset - Resets the settings on the current page.