PurifyHeapValidate

Example       Related Topics

Description

Reports all memory corruption since the last late detect scan. Use this function when you want to perform on-demand validation ranging from specific blocks to every block in every heap, including blocks recently freed.

Syntax

int PurifyHeapValidate

 

(unsigned int hHeap, unsigned int dwFlags, const void *addr)

 

 

hHeap

The handle of the heap, or:

§      NULL, indicating the default heap

§      PURIFY_HEAP_CRT, indicating the CRT heap

§      PURIFY_HEAP_ALL, indicating all heaps

DwFlags

The flags that control the scope of the validation:

§      PURIFY_HEAP_BLOCKS_LIVE, examines only blocks currently allocated

§      PURIFY_HEAP_BLOCKS_DEFERRED_FREE, examines only blocks on the deferred free queue

§      PURIFY_HEAP_BLOCKS_ALL, examines blocks currently allocated and on the deferred free queue

addr

An optional pointer to an individual block you want to validate or NULL, indicating that you want Purify to validate the entire heap.

Returns

0

Purify found errors.

1

Purify did not find any errors.

Notes

§      When you call this function, Purify generates Late Detect Array Bounds Write (ABWL) or Late Detect Free Memory Write (FMWL) messages in the Error View.

§      Late detect scans can impact run-time performance, depending on how often Purify performs the validation and the scope of the validation.

§      You can call PurifyHeapValidate interactively from the Purify View menu while your program is running.

(C) Copyright IBM Corporation 1992, 2010.