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

# Retorno de chamada XMEMALLOC_ROUTINE

> Retorno de chamada XMEMALLOC_ROUTINE

# Retorno de chamada XMEMALLOC\_ROUTINE

Define a sintaxe das rotinas de alocação de memória, [XMemAlloc](/pt-BR/reference/system/xmem/functions/xmemalloc) e `XMemAllocDefault`.

<a id="syntaxSection" />

## Sintaxe

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

<a id="parametersSection" />

### Parâmetros

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

O tamanho do bloco de memória que está sendo solicitado, em bytes.

*Attributes*   \_In\_\
Tipo: ULONGLONG

Os atributos da alocação de memória. Para obter mais informações, consulte [XALLOC\_ATTRIBUTES](/pt-BR/reference/system/xmem/structs/xalloc_attributes).

<a id="retvalSection" />

### Valor retornado

Tipo: PVOID

Um ponteiro para a memória alocada, se bem-sucedido; caso contrário, `NULL`.

<a id="remarksSection" />

## Comentários

Essa definição de função é usada na estrutura [XMEM\_ALLOCATION\_HOOKS](/pt-BR/reference/system/xmem/structs/xmem_allocation_hooks) para definir as funções [XMemAlloc](/pt-BR/reference/system/xmem/functions/xmemalloc) e `XMemAllocDefault`. Da mesma forma, a definição de função [XMEMFREE\_ROUTINE](/pt-BR/reference/system/xmem/functions/xmemfree_routine) é usada para definir as funções [XMemFree](/pt-BR/reference/system/xmem/functions/xmemfree) e `XMemFreeDefault`.

<Note>O código-fonte da implementação padrão de `XMemAlloc` é instalado como parte do Microsoft Game Development Kit (GDK). Para obter mais informações, consulte a função `XMemAllocDefault` em `\GXDK\gameKit\Source\amd64\heap.c`.</Note>

<a id="requirementsSection" />

## Requisitos

**Cabeçalho:** xmem.h

**Biblioteca:** xmem.lib

**Plataformas compatíveis:** consoles da família XBOX One e consoles XBOX Series

<a id="seealsoSection" />

## Confira também

[Diagnóstico e rastreamento de memória](/pt-BR/build/console-features/memory/system-memory-diagnostics)\
[XMem](/pt-BR/reference/system/xmem/xmem_members)\
[XMemAllocDefault](/pt-BR/reference/system/xmem/functions/xmemallocdefault)


## Related topics

- [Retorno de chamada XMEMFREE_ROUTINE](/pt-BR/reference/system/xmem/functions/xmemfree_routine.md)
- [Retorno de chamada PHEAP_TRACK_ALLOC_ROUTINE](/pt-BR/reference/system/xmem/functions/pheap_track_alloc_routine.md)
- [Retorno de chamada PHEAP_TRACK_FREE_ROUTINE](/pt-BR/reference/system/xmem/functions/pheap_track_free_routine.md)
- [Retorno de chamada PHEAP_TRACK_REALLOC_ROUTINE](/pt-BR/reference/system/xmem/functions/pheap_track_realloc_routine.md)
- [XAsyncBlock](/pt-BR/reference/system/xasync/structs/xasyncblock.md)
