> ## 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

# chat\_manager::get\_memory\_callbacks

检索 Game Chat 2 库当前使用的内存分配和释放回调。

## 语法

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

### 参数

*allocateMemoryCallback*   \_Out\_\
类型：[game\_chat\_allocate\_memory\_callback](https://docs.xbox.com/zh-CN/reference/chat/gamechat2/functions/game_chat_allocate_memory_callback.md)\*

指向 Game Chat 2 库当前使用的内存分配回调的指针。

*freeMemoryCallback*   \_Out\_\
类型：[game\_chat\_free\_memory\_callback](https://docs.xbox.com/zh-CN/reference/chat/gamechat2/functions/game_chat_free_memory_callback.md)\*

指向 Game Chat 2 库当前使用的内存释放回调的指针。

### 返回值

类型：void

无。

## 备注

此方法检索指向当前内存分配与释放回调的指针，这些回调用于处理 Game Chat 2 库动态分配和释放内存的请求。你可以调用 [chat\_manager::set\_memory\_callbacks](https://docs.xbox.com/zh-CN/reference/chat/gamechat2/classes/chat_manager/methods/chat_manager_set_memory_callbacks.md) 方法来设置 Game Chat 2 库在需要动态分配和释放内存缓冲区时使用的内存分配和释放回调。

与 `chat_manager::set_memory_callbacks` 方法一样，此方法不要求首先调用 [chat\_manager::initialize](https://docs.xbox.com/zh-CN/reference/chat/gamechat2/classes/chat_manager/methods/chat_manager_initialize.md) 方法。

## 要求

**头文件：** GameChat2.h

**支持的平台：** Windows、XBOX One 系列主机和 XBOX Series 主机

## 另请参阅

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


## Related topics

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