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

# XMemFreeDefault

> XMemFreeDefault

# XMemFreeDefault

默认的内存释放例程。

## 语法

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

### 参数

*Address*    类型：PVOID

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

*Attributes*\
类型：ULONGLONG

\[in] 分配的属性。请参阅 [XALLOC\_ATTRIBUTES](https://docs.xbox.com/zh-CN/reference/system/xmem/structs/xalloc_attributes.md)

**备注**

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

**请参阅**

[*xmem\_set\_allocation\_hooks*](https://docs.xbox.com/zh-CN/reference/system/xmem/macros/xmem_set_allocation_hooks.md)

[*xmem\_allocation\_hooks*](https://docs.xbox.com/zh-CN/reference/system/xmem/structs/xmem_allocation_hooks.md)


## Related topics

- [XMEMFREE_ROUTINE callback](https://docs.xbox.com/zh-CN/reference/system/xmem/functions/xmemfree_routine.md)
- [XMEMALLOC_ROUTINE callback](https://docs.xbox.com/zh-CN/reference/system/xmem/functions/xmemalloc_routine.md)
- [XMemSetAllocationHooks](https://docs.xbox.com/zh-CN/reference/system/xmem/functions/xmemsetallocationhooks.md)
- [XMEM_SET_ALLOCATION_HOOKS](https://docs.xbox.com/zh-CN/reference/system/xmem/macros/xmem_set_allocation_hooks.md)
- [XMemFreePhysicalPages](https://docs.xbox.com/zh-CN/reference/system/xmem/functions/xmemfreephysicalpages.md)
