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

# XMemSetAllocationHysteresis

> XMemSetAllocationHysteresis

# XMemSetAllocationHysteresis

設定指定堆積的遲滯量，並無條件進位至內部配置邊界 (4 MB)。

## 語法

```cpp theme={null}
BOOL XMemSetAllocationHysteresis(  
         DWORD MemType,  
         BOOL LargeHeap,  
         SIZE_T Size  
)  
```

### 參數

*MemType*   \_In\_<br />類型：DWORD

指描述堆積的 **XALLOC\_MEMTYPE\_GRAPHICS** 常數。如需這些常數的詳細資料，請參閱 [XALLOC\_ATTRIBUTES](/zh-TW/reference/system/xmem/structs/xalloc_attributes) 主題。

*LargeHeap*   \_In\_<br />類型：BOOL

如果堆積為「大型」，則為 True；「大型」堆積用於滿足 4 KB 到 128 KB 的配置，或對齊指定為 4 KB 或更高的配置；「小型」堆積用於滿足小於 4 KB 且對齊指定為小於 4 KB 的配置。

*Size*   \_In\_<br />類型：SIZE\_T

遲滯量 (也就是堆積在將額外的可用記憶體歸還給作業系統之前，會保留的最小可用記憶體量)，以位元組為單位。堆積實作可能會將指定的遲滯量無條件進位至內部配置邊界 (目前為 4 MB)。

### 傳回值

類型：BOOL

如果可以設定遲滯，則傳回 TRUE；否則傳回 FALSE。

## 備註

可以在 **XMemAllocDefault** 所維護的每個個別堆積上設定遲滯。XALLOC\_MEMTYPE\_GRAPHICS 常數所列舉的每種記憶體類型都有個別的堆積。**注意：** 只有圖形類型會維護堆積。

若要取得指定堆積的遲滯量，請使用 [XMemGetAllocationHysteresis](/zh-TW/reference/system/xmem/functions/xmemgetallocationhysteresis)。

## 需求

**標頭：** xmem.h

**程式庫：** xmem.lib

**支援的平台：** XBOX One 系列主機和 XBOX Series 主機

## 另請參閱

[XMem 參考](/zh-TW/reference/system/xmem/xmem_members)<br />[XALLOC\_ATTRIBUTES](/zh-TW/reference/system/xmem/structs/xalloc_attributes)<br />[XMemGetAllocationHysteresis](/zh-TW/reference/system/xmem/functions/xmemgetallocationhysteresis)


## Related topics

- [XMemPreallocateFreeSpace](/reference/system/xmem/functions/xmempreallocatefreespace.md)
- [NDA topic directory - live Microsoft Learn links](/nda/nda-topic-directory.md)
- [XMemSetAllocationHooks](/ja-jp/reference/system/xmem/functions/xmemsetallocationhooks.md)
