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

# XMEM_OPTIONS

> XMEM_OPTIONS

# XMEM\_OPTIONS

The **XMEM\_OPTIONS** values are used as the *Option* parameter for the [XMEM\_OPTION](/reference/system/xmem/structs/xmem_option) 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](/reference/system/xmem/xmem_members)


## Related topics

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