/*---------------------------------------------------------------------------* Project: Horizon File: fnd_DetailHeapHead.h Copyright (C)2009 Nintendo Co., Ltd. All rights reserved. These coded instructions, statements, and computer programs contain proprietary information of Nintendo of America Inc. and/or Nintendo Company Ltd., and are protected by Federal copyright law. They may not be disclosed to third parties or copied or duplicated in any form, in whole or in part, without the prior written consent of Nintendo. $Rev: 12449 $ *---------------------------------------------------------------------------*/ /*! @file @brief Heap に関するAPI の宣言 */ #ifndef NN_FND_DETAIL_FND_DETAIL_HEAP_HEAD_H_ #define NN_FND_DETAIL_FND_DETAIL_HEAP_HEAD_H_ #ifdef __cplusplus namespace nn{ namespace fnd{ namespace detail { /*---------------------------------------------------------------------------* Name: NNSFndLink Description: 双方向リンクリストのノード構造体です。この構造体をリスト構造 で繋ぎたい構造体のメンバとして格納します。 *---------------------------------------------------------------------------*/ typedef struct { void* prevObject; // 前に繋がれているオブジェクトへのポインタ。 void* nextObject; // 次に繋がれているオブジェクトへのポインタ。 } NNSFndLink; /*---------------------------------------------------------------------------* Name: NNSFndList Description: 双方向リンクリスト構造体です。 *---------------------------------------------------------------------------*/ typedef struct { void* headObject; // 先頭に繋がれているオブジェクトへのポインタ。 void* tailObject; // 後尾に繋がれているオブジェクトへのポインタ。 u16 numObjects; // リストに繋がれているオブジェクトの個数。 u16 offset; // NNSFndLink型の構造体メンバのオフセット。 } NNSFndList; // メモリのヘッダ情報 struct NNSiFndExpHeapMBlockHead { u16 signature; // シグネチャ u16 attribute; // 属性 // [8:グループID] // [7:アラインメント] // [1:テンポラリフラグ] u32 blockSize; // ブロックサイズ(データ領域のみ) NNSiFndExpHeapMBlockHead* pMBHeadPrev; // 前ブロック NNSiFndExpHeapMBlockHead* pMBHeadNext; // 次ブロック }; // メモリのリスト struct NNSiFndExpMBlockList { NNSiFndExpHeapMBlockHead* head; // 先頭に繋がれているメモリへのポインタ NNSiFndExpHeapMBlockHead* tail; // 後尾に繋がれているメモリへのポインタ }; // 拡張ヒープのヘッダ情報 struct NNSiFndExpHeapHead { NNSiFndExpMBlockList mbFreeList; // フリーリスト NNSiFndExpMBlockList mbUsedList; // 使用リスト u16 groupID; // カレントグループID (下位8bitのみ) u16 feature; // 属性 bool reuse; // アラインメントの際に発生する隙間の領域を再利用するかどうか NN_PADDING3; }; struct ExpHeapImpl { ExpHeapImpl() : signature(0) {} u32 signature; NNSFndLink link; NNSFndList childList; void* heapStart; // ヒープ先頭アドレス void* heapEnd; // ヒープ末尾(+1)アドレス u32 attribute; // 属性 // [8:オプションフラグ] NNSiFndExpHeapHead nnsiFndExpHeapHead; }; }}} // namespace nn::fnd::detail #endif // __cplusplus /* NN_FND_DETAIL_FND_DETAIL_HEAP_HEAD_H_ */ #endif