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

> XMEM_ALLOCATION_HOOKS

# XMEM\_ALLOCATION\_HOOKS

Represents the hooks to memory allocation and de-allocation functions for a title.

<a id="syntaxSection" />

## Syntax

```cpp theme={null}
typedef struct XMEM_ALLOCATION_HOOKS {  
    PXMEMALLOC_ROUTINE AllocRoutine;  
    PXMEMFREE_ROUTINE FreeRoutine;  
} XMEM_ALLOCATION_HOOKS  
```

<a id="membersSection" />

### Members

*AllocRoutine*\
Type: PXMEMALLOC\_ROUTINE

A pointer to the title's allocation function. For more information about implementing an application-defined memory allocation function, see [XMEMALLOC\_ROUTINE](/reference/system/xmem/functions/xmemalloc_routine) and [XMemAlloc](/reference/system/xmem/functions/xmemalloc).

*FreeRoutine*\
Type: PXMEMFREE\_ROUTINE

A pointer to the title's de-allocation function. For more information about implementing an application-defined memory de-allocation function, see [XMEMFREE\_ROUTINE](/reference/system/xmem/functions/xmemfree_routine) and [XMemFree](/reference/system/xmem/functions/xmemfree).

<a id="remarksSection" />

## Remarks

This structure is used by the [XMEM\_SET\_ALLOCATION\_HOOKS](/reference/system/xmem/macros/xmem_set_allocation_hooks) macro to register application-defined memory allocation and de-allocation functions for your title. For more information about graphics memory, see [Graphics memory overview for the GDK](/build/core-features/graphics/graphics-memory-overview).

<Note>The [XMemSetAllocationHooks](/reference/system/xmem/functions/xmemsetallocationhooks) function is deprecated. Use this macro instead of the `XMemSetAllocationHooks` function to register your title's memory allocation and de-allocation functions.</Note>

<a id="requirementsSection" />

## Requirements

**Header:** xmem.h

**Supported platforms:** XBOX One family consoles and XBOX Series consoles

<a id="seealsoSection" />

## See also

[XMEM\_SET\_ALLOCATION\_HOOKS](/reference/system/xmem/macros/xmem_set_allocation_hooks)\
[XMEMALLOC\_ROUTINE](/reference/system/xmem/functions/xmemalloc_routine)\
[XMEMFREE\_ROUTINE](/reference/system/xmem/functions/xmemfree_routine)\
[XMem](/reference/system/xmem/xmem_members)


## Related topics

- [XMemSetAllocationHooks](/reference/system/xmem/functions/xmemsetallocationhooks.md)
- [XMemFreeDefault](/reference/system/xmem/functions/xmemfreedefault.md)
- [XMEMALLOC_ROUTINE callback](/reference/system/xmem/functions/xmemalloc_routine.md)
- [XMEMFREE_ROUTINE callback](/reference/system/xmem/functions/xmemfree_routine.md)
- [XMemSetWin32HeapTrackingHooks](/reference/system/xmem/functions/xmemsetwin32heaptrackinghooks.md)
