Syntax
Parameters
size  _In_ size_t
The size, in bytes, of the allocation to make. This value is never zero.
memoryTypeId  _In_ uint32_t
An opaque identifier for the internal category of memory being allocated. Ignore this value.
Return value
Type: void* A pointer to an allocated block of memory of the specified size, ornullptr if the allocation failed. The header annotates the return value with _Ret_maybenull_ and _Post_writable_byte_size_(size).
Remarks
To install this callback, set it in thealloc member of a PFMemoryHooks structure and pass the structure to PFMemSetFunctions before you call PFInitialize. Set the free member to a matching PFMemFreeFunction callback at the same time. PFMemSetFunctions returns E_INVALIDARG if only one of the two members is set.
The callback must return a pointer to a contiguous block of memory of the requested size. The block must stay valid until PlayFab passes it to your PFMemFreeFunction callback. PlayFab passes every non-null pointer that this callback returns to your PFMemFreeFunction callback when it no longer needs the memory.
If libHttpClient isn’t initialized yet when you call PFMemSetFunctions, PlayFab also installs hooks that route libHttpClient’s allocations through this callback.
To get the hooks that are currently in use, including the default hooks, call PFMemGetFunctions.
PlayFab can call this callback from different threads, so make it thread-safe.
