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

# Rappel XMEMALLOC_ROUTINE

> Rappel XMEMALLOC_ROUTINE

# Rappel XMEMALLOC\_ROUTINE

Définit la syntaxe des routines d'allocation de mémoire, [XMemAlloc](https://docs.xbox.com/fr-CA/reference/system/xmem/functions/xmemalloc.md) et `XMemAllocDefault`.

## Syntaxe

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

### Paramètres

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

La taille du bloc de mémoire demandé, en octets.

*Attributes*   \_In\_\
Type : ULONGLONG

Les attributs de l'allocation de mémoire. Pour plus d'informations, consultez [XALLOC\_ATTRIBUTES](https://docs.xbox.com/fr-CA/reference/system/xmem/structs/xalloc_attributes.md).

### Valeur de retour

Type : PVOID

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

## Remarques

Cette définition de fonction est utilisée dans la structure [XMEM\_ALLOCATION\_HOOKS](https://docs.xbox.com/fr-CA/reference/system/xmem/structs/xmem_allocation_hooks.md) pour définir les fonctions [XMemAlloc](https://docs.xbox.com/fr-CA/reference/system/xmem/functions/xmemalloc.md) et `XMemAllocDefault`. De même, la définition de fonction [XMEMFREE\_ROUTINE](https://docs.xbox.com/fr-CA/reference/system/xmem/functions/xmemfree_routine.md) est utilisée pour définir les fonctions [XMemFree](https://docs.xbox.com/fr-CA/reference/system/xmem/functions/xmemfree.md) 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`.

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

## Voir aussi

[Diagnostics et suivi de la mémoire](https://docs.xbox.com/fr-CA/build/console-features/memory/system-memory-diagnostics.md)\
[XMem](https://docs.xbox.com/fr-CA/reference/system/xmem/xmem_members.md)\
[XMemAllocDefault](https://docs.xbox.com/fr-CA/reference/system/xmem/functions/xmemallocdefault.md)


## Related topics

- [Rappel XMEMFREE_ROUTINE](https://docs.xbox.com/fr-CA/reference/system/xmem/functions/xmemfree_routine.md)
- [Rappel PHEAP_TRACK_ALLOC_ROUTINE](https://docs.xbox.com/fr-CA/reference/system/xmem/functions/pheap_track_alloc_routine.md)
- [Rappel PHEAP_TRACK_FREE_ROUTINE](https://docs.xbox.com/fr-CA/reference/system/xmem/functions/pheap_track_free_routine.md)
- [Rappel PHEAP_TRACK_REALLOC_ROUTINE](https://docs.xbox.com/fr-CA/reference/system/xmem/functions/pheap_track_realloc_routine.md)
- [XMEM_ALLOCATION_HOOKS](https://docs.xbox.com/fr-CA/reference/system/xmem/structs/xmem_allocation_hooks.md)
