Custom Memory Allocation Example
Provides Purify with information about a completed memory reallocation. Call this function right after invoking custom memory block reallocation code.
void *PurifyPostRealloc(void *pActual, unsigned int dwFlags)
pActual |
A pointer to the actual base (including red zones) of the block that has been reallocated. |
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 |
n Where n is a pointer to the base of the block that has been reallocated, within the block's red zones.
§ This function supplies Purify with information about a completed memory block reallocation. It also provides the memory block's base address, adjusted to point within its red zones, for use by your code that works with the memory block. Red zones provide Purify array-bounds detection to any of your code that will use the block after its reallocation. Use this function in conjunction with the PurifyPreRealloc() function, which indicates to Purify when a reallocation 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 custom memory reallocation routines. Purify automatically intercepts standard Windows and C runtime reallocation API functions.
(C) Copyright IBM Corporation 1992, 2010.