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

# XMemFreeDefault

> XMemFreeDefault

# XMemFreeDefault

默认的内存释放例程。

## 语法

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

### 参数

*Address*    类型：PVOID

\[in] 要释放的块的地址，必须先前使用 XMemAllocDefault 分配。

*Attributes*\
类型：ULONGLONG

\[in] 分配的属性。请参阅 [XALLOC\_ATTRIBUTES](/reference/system/xmem/structs/xalloc_attributes)

**备注**

系统导出两个默认函数：[*XMemAllocDefault*](/reference/system/xmem/functions/xmemallocdefault) 和 *XmemFreeDefault*。它们代表分配钩子的初始值。如果游戏选择不提供自己的分配钩子，则将使用这些系统默认分配器。如果游戏出于跟踪目的希望提供分配钩子，但不想实现自己的分配器，则可以直接调用默认分配器。

**请参阅**

[*xmem\_set\_allocation\_hooks*](/reference/system/xmem/macros/xmem_set_allocation_hooks)

[*xmem\_allocation\_hooks*](/reference/system/xmem/structs/xmem_allocation_hooks)


## Related topics

- [XMEMFREE_ROUTINE callback](/zh-CN/reference/system/xmem/functions/xmemfree_routine.md)
- [XMEMALLOC_ROUTINE callback](/zh-CN/reference/system/xmem/functions/xmemalloc_routine.md)
- [XMemSetAllocationHooks](/zh-CN/reference/system/xmem/functions/xmemsetallocationhooks.md)
- [XMemSetOption](/zh-CN/reference/system/xmem/functions/xmemsetoption.md)
- [XMemFreePhysicalPages](/zh-CN/reference/system/xmem/functions/xmemfreephysicalpages.md)
