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

# XMEMFREE_ROUTINE callback

> XMEMFREE_ROUTINE callback

# XMEMFREE\_ROUTINE callback

Defines the syntax of the memory de-allocation routines, [XMemFree](/reference/system/xmem/functions/xmemfree) and `XMemFreeDefault`.

<a id="syntaxSection" />

## Syntax

```cpp theme={null}
VOID XMEMFREE_ROUTINE(  
         PVOID Address,  
         ULONGLONG Attributes  
)  
```

<a id="parametersSection" />

### Parameters

*Address*   \_In\_\
Type: PVOID

The address of the memory to be freed.

*Attributes*   \_In\_\
Type: ULONGLONG

The attributes of the memory allocation. For more information, see [XALLOC\_ATTRIBUTES](/reference/system/xmem/structs/xalloc_attributes).

<a id="retvalSection" />

### Return value

Type: VOID

None.

<a id="remarksSection" />

## Remarks

This function definition is used in the [XMEM\_ALLOCATION\_HOOKS](/reference/system/xmem/structs/xmem_allocation_hooks) structure to define the [XMemFree](/reference/system/xmem/functions/xmemfree) and `XMemFreeDefault` functions. Similarly, the [XMEMALLOC\_ROUTINE](/reference/system/xmem/functions/xmemalloc_routine) function definition is used to define the [XMemAlloc](/reference/system/xmem/functions/xmemalloc) and `XMemAllocDefault` functions.

<Note>Source code for the default implementation of `XMemFree` is installed as part of the Microsoft Game Development Kit (GDK). For more information, see the `XMemFreeDefault` function in `\GXDK\gameKit\Source\amd64\heap.c`.</Note>

<a id="requirementsSection" />

## Requirements

**Header:** xmem.h

**Library:** xmem.lib

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

<a id="seealsoSection" />

## See also

[Diagnostics and memory tracking](/build/console-features/memory/system-memory-diagnostics)\
[XMem](/reference/system/xmem/xmem_members)\
[XMemFreeDefault](/reference/system/xmem/functions/xmemfreedefault)


## Related topics

- [XMEMALLOC_ROUTINE callback](/reference/system/xmem/functions/xmemalloc_routine.md)
- [PHEAP_TRACK_ALLOC_ROUTINE callback](/reference/system/xmem/functions/pheap_track_alloc_routine.md)
- [PHEAP_TRACK_FREE_ROUTINE callback](/reference/system/xmem/functions/pheap_track_free_routine.md)
- [PHEAP_TRACK_REALLOC_ROUTINE callback](/reference/system/xmem/functions/pheap_track_realloc_routine.md)
- [XMemSetAllocationHooks](/reference/system/xmem/functions/xmemsetallocationhooks.md)
