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

# get_memory_callbacks

> chat_manager::get_memory_callbacks

Retrieves the current memory allocation and freeing callbacks used by the Game Chat 2 library.

## Syntax

```cpp theme={null}
void get_memory_callbacks(  
    game_chat_allocate_memory_callback* allocateMemoryCallback,  
    game_chat_free_memory_callback* freeMemoryCallback  
)  
```

### Parameters

*allocateMemoryCallback*   \_Out\_\
Type: [game\_chat\_allocate\_memory\_callback](https://docs.xbox.com/reference/chat/gamechat2/functions/game_chat_allocate_memory_callback.md)\*

A pointer to the memory allocation callback currently used by the Game Chat 2 library.

*freeMemoryCallback*   \_Out\_\
Type: [game\_chat\_free\_memory\_callback](https://docs.xbox.com/reference/chat/gamechat2/functions/game_chat_free_memory_callback.md)\*

A pointer to the memory freeing callback currently used by the Game Chat 2 library.

### Return value

Type: void

None.

## Remarks

This method retrieves the pointers to the current memory allocation & freeing callbacks that service requests to dynamically allocate and free memory by the Game Chat 2 library.  You can call the [chat\_manager::set\_memory\_callbacks](https://docs.xbox.com/reference/chat/gamechat2/classes/chat_manager/methods/chat_manager_set_memory_callbacks.md) method to set the memory allocation and freeing callbacks used by the Game Chat 2 library when a memory buffer must be dynamically allocated and freed.

As with the `chat_manager::set_memory_callbacks` method, this method does not require the [chat\_manager::initialize](https://docs.xbox.com/reference/chat/gamechat2/classes/chat_manager/methods/chat_manager_initialize.md) method to have been called first.

## Requirements

**Header:** GameChat2.h

**Supported platforms:** Windows, XBOX One family consoles and XBOX Series consoles

## See also

[Intro to Game Chat 2](https://docs.xbox.com/services/xbox-services/multiplayer/chat/game-chat2/game-chat-2-intro.md)\
[chat\_manager](https://docs.xbox.com/reference/chat/gamechat2/classes/chat_manager/chat_manager.md)


## Related topics

- [set_memory_callbacks](https://docs.xbox.com/reference/chat/gamechat2/classes/chat_manager/methods/chat_manager_set_memory_callbacks.md)
- [game_chat_allocate_memory_callback](https://docs.xbox.com/reference/chat/gamechat2/functions/game_chat_allocate_memory_callback.md)
- [game_chat_free_memory_callback](https://docs.xbox.com/reference/chat/gamechat2/functions/game_chat_free_memory_callback.md)
- [initialize](https://docs.xbox.com/reference/chat/gamechat2/classes/chat_manager/methods/chat_manager_initialize.md)
- [PartyManager::GetMemoryCallbacks](https://docs.xbox.com/services/playfab/multiplayer/networking/reference/classes/PartyManager/methods/partymanager_getmemorycallbacks.md)
