Skip to main content

XblMemFreeFunction

A callback that the XBOX Services API (XSAPI) invokes each time it no longer needs a previously allocated memory buffer.

Syntax

Parameters

pointer   _In_ _Post_invalid_
Type: void*
The pointer to the memory buffer that was previously allocated by the corresponding XblMemAllocFunction callback. This value is never a null pointer. The pointer is invalid after the callback returns. memoryType   _In_
Type: HCMemoryType
An opaque identifier that represents the internal category of memory that was allocated.

Return value

Type: void

Remarks

XSAPI invokes this callback when it finishes using a memory buffer that the app’s XblMemAllocFunction callback returned, so that the app can free the buffer. This callback is optional. Install it, together with an XblMemAllocFunction callback, by calling XblMemSetFunctions before you call XblInitialize. Both callbacks must be set together. XblMemSetFunctions also passes the callbacks to libHttpClient. If libHttpClient is already initialized, it keeps its existing memory hooks. If you install custom memory callbacks, wait for XblCleanupAsync to complete before you shut down your memory manager. If your app dispatches XSAPI work concurrently, make sure that any allocator state shared by the callbacks is safe for concurrent use. For an example, see XblMemAllocFunction.

Argument of

XblMemSetFunctions
XblMemGetFunctions

Requirements

Header: xbox_live_global_c.h Library: Microsoft.Xbox.Services.142.C.lib or Microsoft.Xbox.Services.143.C.lib

See also

xbox_live_global_c
XblMemAllocFunction
Last modified on October 29, 2026