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

# XMemSetAllocationHooks

> XMemSetAllocationHooks

# XMemSetAllocationHooks

이 API는 더 이상 사용되지 않습니다. 대신 [XMEM\_ALLOCATION\_HOOKS](/reference/system/xmem/structs/xmem_allocation_hooks)를 참조하세요.

타이틀에서 메모리 할당 후크를 등록하는 데 사용됩니다.

## 구문

```cpp theme={null}
VOID XMemSetAllocationHooks(  
         PXMEMALLOC_ROUTINE AllocRoutine,  
         PXMEMFREE_ROUTINE FreeRoutine  
)  
```

### 매개 변수

*AllocRoutine*   \_In\_\
형식: PXMEMALLOC\_ROUTINE

타이틀의 할당 함수에 대한 포인터입니다. 이 함수의 정의는 [XMEMALLOC\_ROUTINE](/reference/system/xmem/functions/xmemalloc_routine) 항목을 참조하세요.

*FreeRoutine*   \_In\_\
형식: PXMEMFREE\_ROUTINE

타이틀의 할당 해제 함수에 대한 포인터입니다. 이 함수의 정의는 [XMEMFREE\_ROUTINE](/reference/system/xmem/functions/xmemfree_routine) 항목을 참조하세요.

### 반환 값

형식: VOID

## 설명

할당은 **XMemSetAllocationHooks** 함수를 통해 타이틀에서 제공되는 콜백을 통해 모니터링(또는 재정의)할 수 있습니다. 이 API를 적절하게 사용하면 타이틀은 타이틀 코드에서 이루어진 거의 모든 할당과 대부분의 플랫폼 코드를 추적할 수 있습니다.

타이틀이 자체 할당 후크를 제공하지 않기로 선택한 경우 **XMemAllocDefault** 및 **XMemFreeDefault**가 대신 사용됩니다(이러한 후크의 선언은 xmem.h를 참조하세요). 타이틀이 추적을 위해 할당 후크를 제공하려고 하지만 자체 할당자를 구현하지 않으려는 경우 기본 할당자를 직접 호출할 수 있습니다.

[XMEMALLOC\_ROUTINE](/reference/system/xmem/functions/xmemalloc_routine) 및 [XMEMFREE\_ROUTINE](/reference/system/xmem/functions/xmemfree_routine)을 후크하는 경우 두 가지 모두에 대한 구현을 제공하는 것이 중요합니다. 그 중 하나만 후크하는 것은 오류로 간주됩니다.

## 요구 사항

**헤더:** xmem.h

**라이브러리:** xmem.lib

**지원 플랫폼:** XBOX One 제품군 콘솔 및 XBOX Series 콘솔

## 함께 보기

[XMem 참조](/reference/system/xmem/xmem_members)\
[XMEMALLOC\_ROUTINE](/reference/system/xmem/functions/xmemalloc_routine)\
[XMEMFREE\_ROUTINE](/reference/system/xmem/functions/xmemfree_routine)


## Related topics

- [XMEM_ALLOCATION_HOOKS](/ko/reference/system/xmem/structs/xmem_allocation_hooks.md)
- [XMemSetWin32HeapTrackingHooks](/ko/reference/system/xmem/functions/xmemsetwin32heaptrackinghooks.md)
- [XMemFreeDefault](/ko/reference/system/xmem/functions/xmemfreedefault.md)
- [PFMemSetFunctions](/ko/services/playfab/api-references/c/pfplatform/functions/pfmemsetfunctions.md)
- [PFMemoryHooks](/ko/services/playfab/api-references/c/pfplatform/structs/pfmemoryhooks.md)
