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

# XMemPreallocateFreeSpace

> XMemPreallocateFreeSpace

# XMemPreallocateFreeSpace

為堆積配置可用頁面，最多至其遲滯值。

<a id="syntaxSection" />

## 語法

```cpp theme={null}
BOOL XMemPreallocateFreeSpace(  
         DWORD MemType,  
         BOOL LargeHeap  
)  
```

<a id="parametersSection" />

### 參數

*MemType*   \_In\_\
類型：DWORD

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

*LargeHeap*   \_In\_\
類型：BOOL

表示堆積是否為「大型」。如果設定為 true，則堆積會被視為「大型」；否則堆積會被視為「小型」。「大型」堆積用於滿足 4 KB 到 128 KB 的配置，或對齊指定為 4 KB 或更高的配置；「小型」堆積用於滿足小於 4 KB 且對齊指定為小於 4 KB 的配置。

<a id="retvalSection" />

### 傳回值

類型：BOOL

如果可以配置所有頁面，則傳回 `TRUE`；否則傳回 `FALSE`。

<a id="remarksSection" />

## 備註

此函式會為 *MemType* 中所描述的堆積配置可用空間，最多至該堆積的遲滯量。請使用 [XMemGetAllocationHysteresis](/zh-TW/reference/system/xmem/functions/xmemgetallocationhysteresis) 來取得堆積的遲滯量，或使用 [XMemSetAllocationHysteresis](/zh-TW/reference/system/xmem/functions/xmemsetallocationhysteresis) 來指定堆積的遲滯量。如需詳細資訊，請參閱[記憶體](/zh-TW/build/console-features/memory/system-memory-overview)。

<a id="requirementsSection" />

## 需求

**標頭：** xmem.h

**程式庫：** xmem.lib

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

<a id="seealsoSection" />

## 另請參閱

[XALLOC\_ATTRIBUTES](/zh-TW/reference/system/xmem/structs/xalloc_attributes)\
[XMem](/zh-TW/reference/system/xmem/xmem_members)


## Related topics

- [XMemPreallocateFreeSpace](/reference/system/xmem/functions/xmempreallocatefreespace.md)
- [XPersistentLocalStorageSpaceInfo](/reference/system/xpersistentlocalstorage/structs/xpersistentlocalstoragespaceinfo.md)
- [XPersistentLocalStorageGetSpaceInfo](/reference/system/xpersistentlocalstorage/functions/xpersistentlocalstoragegetspaceinfo.md)
- [XPersistentLocalStoragePromptUserForSpaceResult](/reference/system/xpersistentlocalstorage/functions/xpersistentlocalstoragepromptuserforspaceresult.md)
- [Working with the Microsoft GDK Game OS memory manager](/build/console-features/memory/system-memory-working.md)
