PIXRecordMemoryFreeEvent

Records a memory freeing event. Provides the data that PIX needs to display information about all memory allocations made from within the title’s custom memory allocators in memory profiling captures. By providing this data, PIX will show all the same data for your custom allocators that it does for calls to VirtualAlloc/VirtualFree and HeapAlloc/HeapFree.

Syntax

void PIXRecordMemoryFreeEvent(
         USHORT allocatorID,
         void *baseAddress,
         size_t size,
         UINT64 metadata
)  

Parameters

allocatorID
Type: USHORT 

An ID you can use to identify groups of memory allocations in the memory profiler. For example, if you have different heaps for things such as graphics, audio, and physics, you can assign each of these categories a different allocatorID so they are easy to identify when viewing a memory capture in PIX.

baseAddress
Type: void *

The address of the memory that has been allocated.

size
Type: size_t 

The size of the memory that has been allocated. PIX uses the baseAddress and size parameters to locate the corresponding allocation as follows: If baseAddress matches the baseAddress passed to the corresponding call to PIXRecordMemoryAllocationEvent, PIX will match up the allocation and free by simply comparing the addresses. In this case, 0 can be passed for the size parameter. If baseAddress is different than the value specified in the corresponding allocation, the size parameter must be specified as nonzero. In this case, PIX will find the corresponding allocations using both baseAddress and size to compute which allocations the free corresponds to.

metadata
Type: UINT64 

A 64-bit unsigned integer you can use to tag an allocation with additional data. This extra data is displayed in PIX in a UserData column. You can use this extra data to identify the type of object within your title that is stored at a given memory location, for example. The value passed to PIXRecordMemoryFreeEvent does not have to match the value passed to the corresponding call to PIXRecordMemoryAllocationEvent.

Return value

None.

Requirements

Header: Declared in pixmemory.h.

Library: Use PIXEvt.lib.

See also

PIX

PIXRecordMemoryAllocationEvent

PIX Custom Memory Allocators