> ## Documentation Index
> Fetch the complete documentation index at: https://devdocs.xbox.com/llms.txt
> Use this file to discover all available pages before exploring further.

# PartyXblManager::SetMemoryCallbacks

> Optionally configures the memory allocation and freeing callbacks the Party XBOX Live Helper library should use.

Optionally configures the memory allocation and freeing callbacks the Party XBOX Live Helper library should use.

## Syntax

```cpp theme={null}
PartyError SetMemoryCallbacks(  
    PartyAllocateMemoryCallback allocateMemoryCallback,  
    PartyFreeMemoryCallback freeMemoryCallback  
)  
```

### Parameters

**`allocateMemoryCallback`**   [PartyAllocateMemoryCallback](/services/playfab/multiplayer/networking/reference/callbacks/partyallocatememorycallback)

A pointer to the custom allocation callback to use.

**`freeMemoryCallback`**   [PartyFreeMemoryCallback](/services/playfab/multiplayer/networking/reference/callbacks/partyfreememorycallback)

A pointer to the custom freeing callback to use.

### Return value

PartyError

`c_partyErrorSuccess` if the call succeeded or an error code otherwise.

## Remarks

This method allows the application to install custom memory allocation routines in order to service all requests by the Party XBOX Live Helper library for new memory buffers instead of using its default allocation routines. <br /><br /> The `allocateMemoryCallback` and `freeMemoryCallback` parameters must both be non-null.   <br /><br /> To use this method, it must be called before any other Party XBOX Live Helper library method except for [GetMemoryCallbacks()](/services/playfab/multiplayer/networking/xblreference/classes/PartyXblManager/methods/partyxblmanager_getmemorycallbacks). This method cannot be called again for the lifetime of this process.

## Requirements

**Header:** PartyXboxLive.h

## See also

[PartyXblManager](/services/playfab/multiplayer/networking/xblreference/classes/PartyXblManager/partyxblmanager)\
[PartyXblManager::GetMemoryCallbacks](/services/playfab/multiplayer/networking/xblreference/classes/PartyXblManager/methods/partyxblmanager_getmemorycallbacks)


## Related topics

- [PartyXblManager::GetMemoryCallbacks](/services/playfab/multiplayer/networking/xblreference/classes/PartyXblManager/methods/partyxblmanager_getmemorycallbacks.md)
- [PartyXblManager::Initialize](/services/playfab/multiplayer/networking/xblreference/classes/PartyXblManager/methods/partyxblmanager_initialize.md)
- [PlayFab Party XBOX Live Helper Release Notes](/services/playfab/multiplayer/networking/party-xboxlive-relnotes.md)
- [PartyManager::SetMemoryCallbacks](/services/playfab/multiplayer/networking/reference/classes/PartyManager/methods/partymanager_setmemorycallbacks.md)
- [PlayFab Party Release Notes](/services/playfab/multiplayer/networking/release-notes.md)
