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

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

## Sintaxe

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

### 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](https://docs.xbox.com/pt-BR/reference/system/xmem/functions/xmemalloc_routine.md) e [XMemAlloc](https://docs.xbox.com/pt-BR/reference/system/xmem/functions/xmemalloc.md).

*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](https://docs.xbox.com/pt-BR/reference/system/xmem/functions/xmemfree_routine.md) e [XMemFree](https://docs.xbox.com/pt-BR/reference/system/xmem/functions/xmemfree.md).

## Comentários

Essa estrutura é usada pela macro [XMEM\_SET\_ALLOCATION\_HOOKS](https://docs.xbox.com/pt-BR/reference/system/xmem/macros/xmem_set_allocation_hooks.md) 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](https://docs.xbox.com/pt-BR/build/core-features/graphics/graphics-memory-overview.md).

> [!NOTE]
>
> A função [XMemSetAllocationHooks](https://docs.xbox.com/pt-BR/reference/system/xmem/functions/xmemsetallocationhooks.md) 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.

## Requisitos

**Cabeçalho:** xmem.h

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

## Confira também

[XMEM\_SET\_ALLOCATION\_HOOKS](https://docs.xbox.com/pt-BR/reference/system/xmem/macros/xmem_set_allocation_hooks.md)\
[XMEMALLOC\_ROUTINE](https://docs.xbox.com/pt-BR/reference/system/xmem/functions/xmemalloc_routine.md)\
[XMEMFREE\_ROUTINE](https://docs.xbox.com/pt-BR/reference/system/xmem/functions/xmemfree_routine.md)\
[XMem](https://docs.xbox.com/pt-BR/reference/system/xmem/xmem_members.md)


## Related topics

- [XMEM_SET_ALLOCATION_HOOKS](https://docs.xbox.com/pt-BR/reference/system/xmem/macros/xmem_set_allocation_hooks.md)
- [XMemSetAllocationHooks](https://docs.xbox.com/pt-BR/reference/system/xmem/functions/xmemsetallocationhooks.md)
- [XMemFreeDefault](https://docs.xbox.com/pt-BR/reference/system/xmem/functions/xmemfreedefault.md)
- [Retorno de chamada XMEMALLOC_ROUTINE](https://docs.xbox.com/pt-BR/reference/system/xmem/functions/xmemalloc_routine.md)
- [Retorno de chamada XMEMFREE_ROUTINE](https://docs.xbox.com/pt-BR/reference/system/xmem/functions/xmemfree_routine.md)
