Skip to main content

Managing Memory Allocations

With the C API in the PlayFab Services SDK, you can specify a function callback that the SDK calls whenever it tries to allocate memory. If you don’t specify function callbacks, the SDK uses standard memory allocation routines. To manually specify your memory routines, you can take the following steps:
  • At the start of the game:
The order matters. PFMemSetFunctions must come before PFInitialize, and PFInitialize must come before PFServicesInitialize. If you skip the explicit PFInitialize call, PFServicesInitialize initializes Core internally—but at that point your memory hooks aren’t applied yet, so the SDK uses default allocation routines instead.
  • While the game is running:
    • Any calls into the SDK that allocate or free memory call the specified memory handling callbacks.
  • When the game exits:

Reference

API reference documentation
Last modified on August 4, 2026