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

# XMEMFREE_ROUTINE callback

> XMEMFREE_ROUTINE callback

# XMEMFREE\_ROUTINE callback

定义内存释放例程 [XMemFree](/reference/system/xmem/functions/xmemfree) 和 `XMemFreeDefault` 的语法。

<a id="syntaxSection" />

## 语法

```cpp theme={null}
VOID XMEMFREE_ROUTINE(  
         PVOID Address,  
         ULONGLONG Attributes  
)  
```

<a id="parametersSection" />

### 参数

*Address*   \_In\_\
类型：PVOID

要释放的内存的地址。

*Attributes*   \_In\_\
类型：ULONGLONG

内存分配的属性。有关更多信息，请参阅 [XALLOC\_ATTRIBUTES](/reference/system/xmem/structs/xalloc_attributes)。

<a id="retvalSection" />

### 返回值

类型：VOID

无。

<a id="remarksSection" />

## 备注

此函数定义在 [XMEM\_ALLOCATION\_HOOKS](/reference/system/xmem/structs/xmem_allocation_hooks) 结构中用于定义 [XMemFree](/reference/system/xmem/functions/xmemfree) 和 `XMemFreeDefault` 函数。同样，[XMEMALLOC\_ROUTINE](/reference/system/xmem/functions/xmemalloc_routine) 函数定义用于定义 [XMemAlloc](/reference/system/xmem/functions/xmemalloc) 和 `XMemAllocDefault` 函数。

<Note>`XMemFree` 默认实现的源代码作为 Microsoft Game Development Kit (GDK) 的一部分进行安装。有关更多信息，请参阅 `\GXDK\gameKit\Source\amd64\heap.c` 中的 `XMemFreeDefault` 函数。</Note>

<a id="requirementsSection" />

## 要求

**标头：** xmem.h

**库：** xmem.lib

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

<a id="seealsoSection" />

## 请参阅

[诊断与内存跟踪](/build/console-features/memory/system-memory-diagnostics)\
[XMem](/reference/system/xmem/xmem_members)\
[XMemFreeDefault](/reference/system/xmem/functions/xmemfreedefault)


## Related topics

- [XMEMALLOC_ROUTINE callback](/zh-CN/reference/system/xmem/functions/xmemalloc_routine.md)
- [PHEAP_TRACK_ALLOC_ROUTINE callback](/zh-CN/reference/system/xmem/functions/pheap_track_alloc_routine.md)
- [PHEAP_TRACK_FREE_ROUTINE callback](/zh-CN/reference/system/xmem/functions/pheap_track_free_routine.md)
- [PHEAP_TRACK_REALLOC_ROUTINE callback](/zh-CN/reference/system/xmem/functions/pheap_track_realloc_routine.md)
- [XMemSetAllocationHooks](/zh-CN/reference/system/xmem/functions/xmemsetallocationhooks.md)
