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

# ApuCreateHeap

> ApuCreateHeap

# ApuCreateHeap

APU 힙을 생성합니다.

## Syntax

```cpp theme={null}
HRESULT ApuCreateHeap(  
         UINT32 cachedSizeInBytes,  
         UINT32 nonCachedSizeInBytes = 0  
)  
```

### Parameters

*cachedSizeInBytes*   \_In\_\
Type: UINT32

캐시된 메모리 할당의 크기(바이트 단위)입니다.

*nonCachedSizeInBytes*   \_In\_opt\_\
Type: UINT32

캐시되지 않은 할당의 크기(바이트 단위)입니다. 0이면 기본 할당인 약 1MB를 사용합니다.

### Return value

Type: HRESULT

이 메서드는 다른 오류 코드 외에도 다음 값을 반환할 수 있습니다:

| 반환 코드                            | 설명                    |
| :------------------------------- | :-------------------- |
| S\_OK                            | 성공                    |
| E\_INVALIDARG                    | 유효하지 않은 인수(size == 0) |
| E\_OUTOFMEMORY                   | 메모리 할당 실패             |
| APU\_E\_HEAP\_ALREADY\_ALLOCATED | 힙이 이미 할당되어 있음         |

## Remarks

APU 힙은 하나만 생성할 수 있으며, 프로세스의 수명 동안 유지됩니다. 힙은 프로세스가 종료될 때만 해제됩니다.

특정 요구사항에 맞게 힙이 할당되도록 하려면 다른 ACP HAL 및 APU 메서드보다 먼저 이 메서드를 호출하세요.

이 메서드보다 먼저 [ACP HAL](/reference/audio/acphal/acphal_members) (AcpHal.h) 또는 [APU](/reference/audio/apu/apu_members) 메서드가 호출되면 캐시된 64MB 힙과 캐시되지 않은 약 1MB 힙이 할당됩니다. 이후 이 메서드를 호출하면 `APU_E_HEAP_ALREADY_ALLOCATED`로 실패합니다.

캐시된 메모리는 모든 Waves 자산과 명령 및 메시지 큐에 사용됩니다. 캐시되지 않은 메모리는 SHAPE 컨텍스트와 알림에 사용됩니다.

## Requirements

**Header:** apu.h

**Library:** acphal.lib

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

## 개념 설명서

* [ACP 개요](/build/console-features/audio/overviews/acp-overview)

## See also

[APU](/reference/audio/apu/apu_members)


## Related topics

- [ApuHeapState](/ko/reference/audio/apu/structs/apuheapstate.md)
- [ApuHeapGetState](/ko/reference/audio/apu/functions/apuheapgetstate.md)
- [APU (오디오 처리 장치)](/ko/reference/audio/apu/apu_members.md)
- [ACP 개요](/ko/build/console-features/audio/overviews/acp-overview.md)
- [IAcpHal::SubmitCommand](/ko/reference/audio/acphal/interfaces/IAcpHal/methods/iacphal_submitcommand.md)
