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

# XMEM_OPTIONS

> XMEM_OPTIONS

The **XMEM\_OPTIONS** values are used as the *Option* parameter for the [XMEM\_OPTION](https://docs.xbox.com/reference/system/xmem/structs/xmem_option.md) struct.  The parameter type indicates which parameter (Bool, Int, or Pointer) should be set when populating the struct.

## Syntax

```cpp theme={null}
typedef enum _XMEM_OPTIONS    
{  
    eXMEMOPT_VALIDATE_XMEMALLOC = 0x1,  
    eXMEMOPT_XMEMALLOCDEFAULT_TAG_VIRTUALALLOC = 0x2,  
    eXMEMOPT_RAISE_HEAPFREE_CALLBACK_ON_REALLOC = 0x3,  
    eXMEMOPT_XMEMALLOCDEFAULT_DISABLEPAGESIZEDEMOTION = 0x4,  
    eXMEMOPT_XMEMALLOCDEFAULT_TRAPUSEAFTERFREE = 0x5,  
    eXMEMOPT_XMEMALLOCDEFAULT_USE64KPAGES = 0x6,
    eXMEMOPT_ALLOW_WRITEABLE_FILEMAPPINGS = 0x7,
    eXMEMOPT_MAX = 0xFFFF,
} XMEM_OPTIONS  
```

## Constants

| Constant | Parameter Type | Description |
| - | - | - |
| eXMEMOPT\_VALIDATE\_XMEMALLOC | BOOL | Enables runtime validation of memory returned by XMemAlloc. |
| eXMEMOPT\_XMEMALLOCDEFAULT\_TAG\_VIRTUALALLOC | BOOL | Enables commit tagging of XMemVirtualAlloc allocations made by XMemAllocDefault. |
| eXMEMOPT\_RAISE\_HEAPFREE\_CALLBACK\_ON\_REALLOC | BOOL | Enables raising a heapfree callback on reallocations. |
| eXMEMOPT\_XMEMALLOCDEFAULT\_DISABLEPAGESIZEDEMOTION | BOOL | Disables automatic demotion from 2MB to 64KB for the XMem heaps. |
| eXMEMOPT\_XMEMALLOCDEFAULT\_TRAPUSEAFTERFREE | BOOL | Promotes all XMemAlloc/XMemFree calls that utilize the internal heaps to XMemVirtualAlloc/VirtualFree |
| eXMEMOPT\_XMEMALLOCDEFAULT\_USE64KPAGES | BOOL | Configures the XMem heaps to use 64KB pages instead of 2MB pages |
| eXMEMOPT\_ALLOW\_WRITEABLE\_FILEMAPPINGS | BOOL | If enabled, allows CreateFileMappingA/W to succeed when called with writeable flags |

## Requirements

**Header:** xmem.h
**Supported Platforms**: XBOX One family consoles and XBOX Series consoles

## See also

[xmem](https://docs.xbox.com/reference/system/xmem/xmem_members.md)


## Related topics

- [XMEM_OPTION](https://docs.xbox.com/reference/system/xmem/structs/xmem_option.md)
- [XMemSetOption](https://docs.xbox.com/reference/system/xmem/functions/xmemsetoption.md)
- [XMemMapPhysicalPagesScatter](https://docs.xbox.com/reference/system/xmem/functions/xmemmapphysicalpagesscatter.md)
- [XMemVirtualQuery](https://docs.xbox.com/reference/system/xmem/functions/xmemvirtualquery.md)
- [XMEM_ALLOCATION_HOOKS](https://docs.xbox.com/reference/system/xmem/structs/xmem_allocation_hooks.md)
