Skip to main content
A callback that PlayFab calls every time a memory buffer that it allocated is no longer needed and can be freed.

Syntax

Parameters

pointer   _In_ _Post_invalid_ void* The pointer to the memory buffer that your PFMemAllocFunction callback allocated. This value is never nullptr. The pointer isn’t valid after the callback returns. memoryTypeId   _In_ uint32_t An opaque identifier for the internal category of memory being freed. Ignore this value.

Return value

Type: void

Remarks

To install this callback, set it in the free member of a PFMemoryHooks structure and pass the structure to PFMemSetFunctions before you call PFInitialize. Set the alloc member to a matching PFMemAllocFunction callback at the same time. PFMemSetFunctions returns E_INVALIDARG if only one of the two members is set. PlayFab calls this callback when it has finished using a memory buffer that your PFMemAllocFunction callback returned, so that you can free the buffer. PlayFab doesn’t call this callback with nullptr. If libHttpClient isn’t initialized yet when you call PFMemSetFunctions, PlayFab also installs hooks that route libHttpClient’s frees through this callback. PlayFab can call this callback from different threads, so make it thread-safe.

Requirements

Header: PFPlatform.h Library: PlayFabCore.lib Supported platforms: Windows, XBOX One family consoles, and XBOX Series consoles

See also

PFPlatform members PFMemoryHooks PFMemAllocFunction
Last modified on November 3, 2026