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

# PIXRecordMemoryAllocationEvent

> PIXRecordMemoryAllocationEvent

# PIXRecordMemoryAllocationEvent

メモリ割り当てイベントを記録します。

## 構文

```cpp theme={null}
void PIXRecordMemoryAllocationEvent(  
         USHORT allocatorId,  
         void* baseAddress,  
         size_t size,  
         UINT64 metadata  
)  
```

### パラメーター

*allocatorId*   <br />Type: USHORT

メモリ プロファイラーでメモリ割り当てのグループを識別するために使用できる ID です。たとえば、グラフィック、オーディオ、物理演算など、目的別に異なるヒープがある場合、これらの各カテゴリに異なる **allocatorID** を割り当てることで、PIX でメモリ キャプチャを表示するときに識別しやすくなります。

*baseAddress*   <br />Type: void\*

割り当てられたメモリの開始アドレスです。

*size*   <br />Type: size\_t

割り当てられたメモリのサイズ (バイト単位) です。

*metadata*   <br />Type: UINT64

割り当てに追加データをタグ付けするために使用できる 64 ビット符号なし整数です。この追加データは PIX の **UserData** 列に表示されます。この追加データを使用して、たとえば特定のメモリ位置に格納されているタイトル内のオブジェクトの種類を識別できます。

### 戻り値

Type: void

## 解説

PIX メモリ追跡イベントは、タイトルのカスタム メモリ アロケーターから行われたすべてのメモリ割り当ておよび解放に関する情報を、メモリ プロファイリング キャプチャで PIX が表示するために必要なデータを提供します。このデータを提供することにより、PIX はカスタム アロケーターについても **VirtualAlloc**/**VirtualFree** および **HeapAlloc**/**HeapFree** の呼び出しに対して表示するのと同じデータをすべて表示します。

同時に多数のイベントが発生していたり、システムが高負荷状態にあると、メモリ イベントが Event Tracing for Windows (ETW) によって失われる可能性があります。イベントの損失は、データ分析の不完全性につながります。PIX のメモリ キャプチャ UI にはイベント損失を示す警告が表示されます。

複数の [PIXRecordMemoryFreeEvent](/reference/tools/pix3/functions/pixrecordmemoryfreeevent) 呼び出しを使用して、1 回の割り当てから段階的に解放されるメモリを追跡できます。

カスタム割り当ておよび解放のデータがメモリ キャプチャでどのように表示されるかについては、「[PIX カスタム メモリ アロケーター (NDA トピック)](/tools/tools-console/pix/pix-custom-memory-allocators)」をご覧ください。

## 要件

**ヘッダー:** pixmemory.h

**ライブラリ:** pixevt.lib

**サポートされているプラットフォーム:** XBOX One ファミリ本体および XBOX Series 本体

## 概念ドキュメント

* [ATG Systems Engagement Checklist](/build/atg-engagement/atg-systems-engagement)

## 関連項目

[PIX (NDA トピック)](/tools/tools-console/pix/pix)

[PIX カスタム メモリ アロケーター (NDA トピック)](/tools/tools-console/pix/pix-custom-memory-allocators)

[PIX API リファレンス](/reference/tools/pix3/pix3_members)

[PIXRecordMemoryFreeEvent](/reference/tools/pix3/functions/pixrecordmemoryfreeevent)


## Related topics

- [PIXRecordMemoryFreeEvent](/ja-jp/reference/tools/pix3/functions/pixrecordmemoryfreeevent.md)
- [PIX3](/ja-jp/reference/tools/pix3/pix3_members.md)
- [DSTORAGE_ERROR_RECORD](/ja-jp/reference/system/dstorage/structs/dstorage_error_record.md)
- [XMEM_ALLOCATION_HOOKS](/ja-jp/reference/system/xmem/structs/xmem_allocation_hooks.md)
- [IDStorageQueueX::RetrieveErrorRecord](/ja-jp/reference/system/dstorage/interfaces/IDStorageQueueX/methods/idstoragequeuex_retrieveerrorrecord.md)
