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

> XMEM_ALLOCATION_HOOKS

# XMEM\_ALLOCATION\_HOOKS

Représente les hooks vers les fonctions d'allocation et de désallocation de mémoire d'un titre.

## Syntaxe

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

### Membres

*AllocRoutine*\
Type : PXMEMALLOC\_ROUTINE

Pointeur vers la fonction d'allocation du titre. Pour plus d'informations sur l'implémentation d'une fonction d'allocation de mémoire définie par l'application, consultez [XMEMALLOC\_ROUTINE](https://docs.xbox.com/fr/reference/system/xmem/functions/xmemalloc_routine.md) et [XMemAlloc](https://docs.xbox.com/fr/reference/system/xmem/functions/xmemalloc.md).

*FreeRoutine*\
Type : PXMEMFREE\_ROUTINE

Pointeur vers la fonction de désallocation du titre. Pour plus d'informations sur l'implémentation d'une fonction de désallocation de mémoire définie par l'application, consultez [XMEMFREE\_ROUTINE](https://docs.xbox.com/fr/reference/system/xmem/functions/xmemfree_routine.md) et [XMemFree](https://docs.xbox.com/fr/reference/system/xmem/functions/xmemfree.md).

## Remarques

Cette structure est utilisée par la macro [XMEM\_SET\_ALLOCATION\_HOOKS](https://docs.xbox.com/fr/reference/system/xmem/macros/xmem_set_allocation_hooks.md) pour inscrire les fonctions d'allocation et de désallocation de mémoire définies par l'application pour votre titre. Pour plus d'informations sur la mémoire graphique, consultez [Vue d'ensemble de la mémoire graphique pour le GDK](https://docs.xbox.com/fr/build/core-features/graphics/graphics-memory-overview.md).

> [!NOTE]
>
> La fonction [XMemSetAllocationHooks](https://docs.xbox.com/fr/reference/system/xmem/functions/xmemsetallocationhooks.md) est déconseillée. Utilisez cette macro au lieu de la fonction `XMemSetAllocationHooks` pour inscrire les fonctions d'allocation et de désallocation de mémoire de votre titre.

## Configuration requise

**En-tête :** xmem.h

**Plateformes prises en charge :** consoles de la famille XBOX One et consoles XBOX Series

## Voir aussi

[XMEM\_SET\_ALLOCATION\_HOOKS](https://docs.xbox.com/fr/reference/system/xmem/macros/xmem_set_allocation_hooks.md)\
[XMEMALLOC\_ROUTINE](https://docs.xbox.com/fr/reference/system/xmem/functions/xmemalloc_routine.md)\
[XMEMFREE\_ROUTINE](https://docs.xbox.com/fr/reference/system/xmem/functions/xmemfree_routine.md)\
[XMem](https://docs.xbox.com/fr/reference/system/xmem/xmem_members.md)


## Related topics

- [XMEM_SET_ALLOCATION_HOOKS](https://docs.xbox.com/fr/reference/system/xmem/macros/xmem_set_allocation_hooks.md)
- [XMemSetAllocationHooks](https://docs.xbox.com/fr/reference/system/xmem/functions/xmemsetallocationhooks.md)
- [XMemFreeDefault](https://docs.xbox.com/fr/reference/system/xmem/functions/xmemfreedefault.md)
- [Rappel XMEMALLOC_ROUTINE](https://docs.xbox.com/fr/reference/system/xmem/functions/xmemalloc_routine.md)
- [Rappel XMEMFREE_ROUTINE](https://docs.xbox.com/fr/reference/system/xmem/functions/xmemfree_routine.md)
