バージョン

menu_open
警告:あなたのメジャーリリース ( 2024.1.1.8691 ) に該当する最新ドキュメンテーションが表示されています。特定バージョンのドキュメンテーションにアクセスするには、Audiokinetic Launcherでオフラインドキュメンテーションをダウンロードし、Wwise AuthoringのOffline Documentationオプションにチェックを入れてください。
警告:このページでは、一部の保護された情報が表示されません。
あなたが特定プラットフォームのライセンスを所有しているユーザであれば、最初にログインしてください。
Wwise SDK 2024.1.1
メモリマネージャ

Wwiseサウンドエンジンのすべてのモジュールは、AK::MemoryMgr インターフェイスを介してメモリにアクセスします。サウンドエンジンクライアントによって、このインターフェイスの初期化および終了が行われます。

デフォルト実装は、静的ライブラリ(AkMemoryMgr.lib)としてSDKで提供されています。このライブラリを使うには、クライアントは、 AkModule.h ヘッダを含めて、 AK::MemoryMgr::Init の初期化関数をコールする必要があります。

AkMemoryMgr.libとその他ライブラリの使用に関する詳細は ビルド構成 を参照してください。

初期化

デフォルト実装では、デフォルトの初期化設定を AK::MemoryMgr::GetDefaultSettings を使い取得できます。

Using the Default Memory Allocator

By default, all memory is allocated by Wwise using the built-in AkMemoryArenas, each of which can be configured separately using the AkMemSettings::memoryArenaSettings array. There are up to four AkMemoryArenas that can be configured:

  • AkMemoryMgrArena_Primary: The default AkMemoryArena used by most memory categories.
  • AkMemoryMgrArena_Media: The AkMemoryArena used for memory allocations that go to the Media memory category, usually from loading SoundBanks.
  • AkMemoryMgrArena_Profiler: The AkMemoryArena used for memory allocations that go to the Profiler and Monitor Queue memory categories. This AkMemoryArena does not exist in the Release build configuration.
  • AkMemoryMgrArena_Device: The AkMemoryArena used for handling any device-specific memory allocations. This is present only on specific platforms that use device-specific memory for audio processing, that is, any platform that has AK_DEVICE_MEMORY_SUPPORTED defined.

We recommend you implement the following callbacks for each of the AkMemoryArenas, for integration into a game engine, as they are used by the AkMemoryArena to acquire and release spans of memory as needed.

  • AkMemoryArenaSettings::fnMemAllocSpan
  • AkMemoryArenaSettings::fnMemFreeSpan

AkMemoryArenaSettings::uMemReservedLimit is also available to set limits on how much memory is reserved by each AkMemoryArena.

Refer to Configuration and Tuning of AkMemoryArenas for information on other settings available for configuring the AkMemoryArena.

Using a Custom Memory Allocator

To override the use of AkMemoryArena and use a custom allocator for every memory allocation, provide overrides of all of these callbacks:

It is important for the allocation functions above to honor the AkMemType_Device bit by returning device memory when the bit is set.

注釈: Profiling of AkMemoryArenas in Wwise is not available when using a custom memory allocator.

Configuration for Debugging

追加のランタイムデバグ機能を有効にするには、以下の設定を使います:

これは、カスタム実装で、好きなだけのメモリデバグ機能を定義できるようにする不透明な値です。デフォルトの実装で、2つのレベルが提供されます。

  • Level 1は基本的なランタイムメモリデバグを有効にし、これに含まれるのは、アロケーションごとの FILELINE のキャプチャ、アロケーションごとのcallstackのトラッキング(可能な場合)、シャットダウン時の詳細なリーク報告、そして非常に軽いインテグリティチェックなどです。開発中にデフォルトで実行できるほど、軽いものです。
  • Level 2はstompアロケータの使用を有効にして各アロケーションでバーチャルメモリの個別のページを使い、out of boundsで発生する書き込みをトラップしようとします。これは、非常に遅くてリソース負荷の高いモードなので、開発中にデフォルトで有効にするのは避け、メモリストンプの原因を探し出そうとするときに限り使うことを、推奨します。

全てのアロケーションをファイルにダンプするには、以下を使います(必ず、 AkMemSettings::uMemoryDebugLevel を1として、Releaseコンフィギュレーションでないものを使ってください):

備考: サウンドエンジンが、 AK::IAkStreamMgr::CreateStd() を使って書き込み用のストリームを開きます。Stream Managerのデフォルト実装を使用している場合は、ファイルを開く処理は、Low-Level IOインターフェースの AK::StreamMgr::IAkLowLevelIOHook::BatchOpen() を実装した時に実行されます。

Use the following settings to perform tracking of allocations for debugging purposes (these are not called in the Release configuration):

The debug functions above do not replace the allocation functions; they are notification callbacks for the various memory allocation events.

詳細については、以下のセクションを参照してください:

メモリマネージャのオーバーライド

クライアントは、 AK::MemoryMgr のインターフェースのカスタム化された実装を提供することができます。 AkMemoryMgr.h で定義されている関数は、すべて実装してください。 AkModule.h で定義された AK::MemoryMgr ネームスペースの関数は、メモリマネージャのデフォルト実装のためのものなので、実装する必要はありません。

As when overriding the various allocation functions of AkMemSettings, when writing a new AK::MemoryMgr implementation care must be taken to honor the AkMemType_Device bit by returning device memory when the bit is set. デバイスのメモリアロケーションは、一部のプラットフォームでしか使われていなく、具体的なパラメータに準拠する必要があるので、詳しくはプラットフォーム別のセクションを参照してください。


このページはお役に立ちましたか?

サポートは必要ですか?

ご質問や問題、ご不明点はございますか?お気軽にお問い合わせください。

サポートページをご確認ください

あなたのプロジェクトについて教えてください。ご不明な点はありませんか。

プロジェクトを登録していただくことで、ご利用開始のサポートをいたします。

Wwiseからはじめよう