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

# XMEMALLOC_ROUTINE callback

> XMEMALLOC_ROUTINE callback

# Devolución de llamada XMEMALLOC\_ROUTINE

Define la sintaxis de las rutinas de asignación de memoria, [XMemAlloc](/reference/system/xmem/functions/xmemalloc) y `XMemAllocDefault`.

<a id="syntaxSection" />

## Sintaxis

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

<a id="parametersSection" />

### Parámetros

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

El tamaño del bloque de memoria que se solicita, en bytes.

*Attributes*   \_In\_\
Tipo: ULONGLONG

Los atributos de la asignación de memoria. Para obtener más información, consulte [XALLOC\_ATTRIBUTES](/reference/system/xmem/structs/xalloc_attributes).

<a id="retvalSection" />

### Valor devuelto

Tipo: PVOID

Un puntero a la memoria asignada, si se realiza correctamente; de lo contrario, `NULL`.

<a id="remarksSection" />

## Comentarios

Esta definición de función se usa en la estructura [XMEM\_ALLOCATION\_HOOKS](/reference/system/xmem/structs/xmem_allocation_hooks) para definir las funciones [XMemAlloc](/reference/system/xmem/functions/xmemalloc) y `XMemAllocDefault`. De manera similar, la definición de función [XMEMFREE\_ROUTINE](/reference/system/xmem/functions/xmemfree_routine) se usa para definir las funciones [XMemFree](/reference/system/xmem/functions/xmemfree) y `XMemFreeDefault`.

<Note>El código fuente de la implementación predeterminada de `XMemAlloc` se instala como parte del Microsoft Game Development Kit (GDK). Para obtener más información, consulte la función `XMemAllocDefault` en `\GXDK\gameKit\Source\amd64\heap.c`.</Note>

<a id="requirementsSection" />

## Requisitos

**Encabezado:** xmem.h

**Biblioteca:** xmem.lib

**Plataformas compatibles:** consolas de la familia XBOX One y consolas XBOX Series

<a id="seealsoSection" />

## Consulte también

[Diagnóstico y seguimiento de memoria](/build/console-features/memory/system-memory-diagnostics)\
[XMem](/reference/system/xmem/xmem_members)\
[XMemAllocDefault](/reference/system/xmem/functions/xmemallocdefault)


## Related topics

- [XMEMFREE_ROUTINE callback](/es/reference/system/xmem/functions/xmemfree_routine.md)
- [PHEAP_TRACK_ALLOC_ROUTINE callback](/es/reference/system/xmem/functions/pheap_track_alloc_routine.md)
- [PHEAP_TRACK_FREE_ROUTINE callback](/es/reference/system/xmem/functions/pheap_track_free_routine.md)
- [PHEAP_TRACK_REALLOC_ROUTINE callback](/es/reference/system/xmem/functions/pheap_track_realloc_routine.md)
- [XMEM_ALLOCATION_HOOKS](/es/reference/system/xmem/structs/xmem_allocation_hooks.md)
