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

***

title: "XMEMALLOC\_ROUTINE callback"
description: "XMEMALLOC\_ROUTINE callback"
sidebarTitle: "XMEMALLOC\_ROUTINE callback"
\u0001\u0001\u0001---

# XMEMALLOC\_ROUTINE callback

메모리 할당 루틴 [XMemAlloc](/reference/system/xmem/functions/xmemalloc) 및 `XMemAllocDefault`의 구문을 정의합니다.

<a id="syntaxSection" />

## 구문

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

<a id="parametersSection" />

### 매개 변수

*Size*   \_In\_\
형식: SIZE\_T

요청 중인 메모리 블록의 크기(바이트)입니다.

*Attributes*   \_In\_\
형식: ULONGLONG

메모리 할당의 특성입니다. 자세한 내용은 [XALLOC\_ATTRIBUTES](/reference/system/xmem/structs/xalloc_attributes)를 참조하세요.

<a id="retvalSection" />

### 반환 값

형식: PVOID

성공하면 할당된 메모리에 대한 포인터이고, 그렇지 않으면 `NULL`입니다.

<a id="remarksSection" />

## 설명

이 함수 정의는 [XMEM\_ALLOCATION\_HOOKS](/reference/system/xmem/structs/xmem_allocation_hooks) 구조체에서 [XMemAlloc](/reference/system/xmem/functions/xmemalloc) 및 `XMemAllocDefault` 함수를 정의하는 데 사용됩니다. 마찬가지로, [XMEMFREE\_ROUTINE](/reference/system/xmem/functions/xmemfree_routine) 함수 정의는 [XMemFree](/reference/system/xmem/functions/xmemfree) 및 `XMemFreeDefault` 함수를 정의하는 데 사용됩니다.

<Note>`XMemAlloc`의 기본 구현에 대한 소스 코드는 Microsoft Game Development Kit(GDK)의 일부로 설치됩니다. 자세한 내용은 `\GXDK\gameKit\Source\amd64\heap.c`의 `XMemAllocDefault` 함수를 참조하세요.</Note>

<a id="requirementsSection" />

## 요구 사항

**헤더:** xmem.h

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

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

<a id="seealsoSection" />

## 함께 보기

[Diagnostics and memory tracking](/build/console-features/memory/system-memory-diagnostics)\
[XMem](/reference/system/xmem/xmem_members)\
[XMemAllocDefault](/reference/system/xmem/functions/xmemallocdefault)


## Related topics

- [XMEM_ALLOCATION_HOOKS](/ko/reference/system/xmem/structs/xmem_allocation_hooks.md)
- [XMEMFREE_ROUTINE callback](/ko/reference/system/xmem/functions/xmemfree_routine.md)
- [XMemSetAllocationHooks](/ko/reference/system/xmem/functions/xmemsetallocationhooks.md)
- [XALLOC_ALLOCATOR_IDS](/ko/reference/system/xmem/enums/xalloc_allocator_ids.md)
- [XMEM_OPTIONS](/ko/reference/system/xmem/enums/xmem_options.md)
