Custom Memory Allocation Example
Provides Purify with information about a completed memory block size request. Call this function right after invoking custom code that looks up a memory block's size.
size_t PurifyPostGetSize(size_t cbActual, unsigned int dwFlags)
cbActual |
The total size (including red zones) of a memory block whose total size has just been determined. |
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 the size of the block, within its red zones. |
§ This function supplies Purify with information about a completed request to look up a memory block's size. This function returns the size of the memory block, within the block's 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 uses the block. Use this function in conjunction with the PurifyPreGetSize() function, which indicates to Purify when a block size 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.