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

# XMEM_ALLOCATION_HOOKS

> XMEM_ALLOCATION_HOOKS

# XMEM\_ALLOCATION\_HOOKS

Representa os ganchos para as funções de alocação e desalocação de memória de um título.

<a id="syntaxSection" />

## Sintaxe

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

<a id="membersSection" />

### Membros

*AllocRoutine*\
Tipo: PXMEMALLOC\_ROUTINE

Um ponteiro para a função de alocação do título. Para obter mais informações sobre como implementar uma função de alocação de memória definida pelo aplicativo, consulte [XMEMALLOC\_ROUTINE](/pt-BR/reference/system/xmem/functions/xmemalloc_routine) e [XMemAlloc](/pt-BR/reference/system/xmem/functions/xmemalloc).

*FreeRoutine*\
Tipo: PXMEMFREE\_ROUTINE

Um ponteiro para a função de desalocação do título. Para obter mais informações sobre como implementar uma função de desalocação de memória definida pelo aplicativo, consulte [XMEMFREE\_ROUTINE](/pt-BR/reference/system/xmem/functions/xmemfree_routine) e [XMemFree](/pt-BR/reference/system/xmem/functions/xmemfree).

<a id="remarksSection" />

## Comentários

Essa estrutura é usada pela macro [XMEM\_SET\_ALLOCATION\_HOOKS](/pt-BR/reference/system/xmem/macros/xmem_set_allocation_hooks) para registrar funções de alocação e desalocação de memória definidas pelo aplicativo para o seu título. Para obter mais informações sobre memória gráfica, consulte [Visão geral da memória gráfica do GDK](/pt-BR/build/core-features/graphics/graphics-memory-overview).

<Note>A função [XMemSetAllocationHooks](/pt-BR/reference/system/xmem/functions/xmemsetallocationhooks) foi preterida. Use essa macro em vez da função `XMemSetAllocationHooks` para registrar as funções de alocação e desalocação de memória do seu título.</Note>

<a id="requirementsSection" />

## Requisitos

**Cabeçalho:** xmem.h

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

<a id="seealsoSection" />

## Confira também

[XMEM\_SET\_ALLOCATION\_HOOKS](/pt-BR/reference/system/xmem/macros/xmem_set_allocation_hooks)\
[XMEMALLOC\_ROUTINE](/pt-BR/reference/system/xmem/functions/xmemalloc_routine)\
[XMEMFREE\_ROUTINE](/pt-BR/reference/system/xmem/functions/xmemfree_routine)\
[XMem](/pt-BR/reference/system/xmem/xmem_members)


## Related topics

- [XMEM_ALLOCATION_HOOKS](/reference/system/xmem/structs/xmem_allocation_hooks.md)
- [XMemSetAllocationHooks](/reference/system/xmem/functions/xmemsetallocationhooks.md)
