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

# Rappel XMEMALLOC_ROUTINE

> Rappel XMEMALLOC_ROUTINE

# Rappel XMEMALLOC\_ROUTINE

Définit la syntaxe des routines d'allocation de mémoire, [XMemAlloc](/fr/reference/system/xmem/functions/xmemalloc) et `XMemAllocDefault`.

<a id="syntaxSection" />

## Syntaxe

```cpp theme={null}
PVOID XMEMALLOC_ROUTINE(  
         SIZE_T Size,  
         ULONGLONG Attributes  
)  
```

<a id="parametersSection" />

### Paramètres

*Size*   \_In\_\
Type : SIZE\_T

Taille du bloc de mémoire demandé, en octets.

*Attributes*   \_In\_\
Type : ULONGLONG

Attributs de l'allocation de mémoire. Pour plus d'informations, consultez [XALLOC\_ATTRIBUTES](/fr/reference/system/xmem/structs/xalloc_attributes).

<a id="retvalSection" />

### Valeur de retour

Type : PVOID

Pointeur vers la mémoire allouée en cas de réussite ; sinon, `NULL`.

<a id="remarksSection" />

## Remarques

Cette définition de fonction est utilisée dans la structure [XMEM\_ALLOCATION\_HOOKS](/fr/reference/system/xmem/structs/xmem_allocation_hooks) pour définir les fonctions [XMemAlloc](/fr/reference/system/xmem/functions/xmemalloc) et `XMemAllocDefault`. De même, la définition de fonction [XMEMFREE\_ROUTINE](/fr/reference/system/xmem/functions/xmemfree_routine) est utilisée pour définir les fonctions [XMemFree](/fr/reference/system/xmem/functions/xmemfree) et `XMemFreeDefault`.

<Note>Le code source de l'implémentation par défaut de `XMemAlloc` est installé avec le Microsoft Game Development Kit (GDK). Pour plus d'informations, consultez la fonction `XMemAllocDefault` dans `\GXDK\gameKit\Source\amd64\heap.c`.</Note>

<a id="requirementsSection" />

## Configuration requise

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

**Bibliothèque :** xmem.lib

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

<a id="seealsoSection" />

## Voir aussi

[Diagnostics et suivi de la mémoire](/fr/build/console-features/memory/system-memory-diagnostics)\
[XMem](/fr/reference/system/xmem/xmem_members)\
[XMemAllocDefault](/fr/reference/system/xmem/functions/xmemallocdefault)


## Related topics

- [Xmemalloc routine](/ko/reference/system/xmem/functions/xmemalloc_routine.md)
- [XMEMALLOC_ROUTINE callback](/reference/system/xmem/functions/xmemalloc_routine.md)
- [XMEMFREE_ROUTINE callback](/reference/system/xmem/functions/xmemfree_routine.md)
- [XMEM_ALLOCATION_HOOKS](/reference/system/xmem/structs/xmem_allocation_hooks.md)
