PurifyPostDidAlloc

Custom Memory Allocation Example

Related Topics

Description

Provides Purify with information about a completed memory block lookup. Call this function right after invoking custom code that checks for the existence of a memory block.

Syntax

void *PurifyPostDidAlloc(void *pRequest, int fActual, unsigned int dwFlags)

 

pRequest

The address of the block whose existence has been determined, within its red zones.

fActual

An integer value indicating whether your custom code found an existing block at the specified address.

dwFlags

May include any of the following flags, or 0 to indicate none of them: 

 

Flag 

Meaning 

PURIFY_TRACK_AS_HEAP

The block is allocated within a Windows heap

PURIFY_TRACK_NO_REDZONE

Purify should not pad the block with red zones

Returns

fActual

Where fActual is the same integer value provided as the second parameter above.

Notes

§      This function supplies Purify with information about a completed request to look up a memory block. Use this function in conjunction with the PurifyPreDidAlloc() function, which indicates to Purify when a block lookup is pending.

§      This function is a member of Purify's memory tracking interface. The example code provided for Purify's memory tracking interface demonstrates this function.

§      This function is necessary only for memory blocks that have been created by custom allocation routines. Purify automatically intercepts standard Windows and C runtime API functions.

(C) Copyright IBM Corporation 1992, 2010.