| 1 | #ifndef SEAD_HEAP_POLICIES_H_ |
| 2 | #define SEAD_HEAP_POLICIES_H_ |
| 3 | |
| 4 | #include <basis/seadTypes.h> |
| 5 | #include <heap/seadHeapMgr.h> |
| 6 | |
| 7 | namespace sead |
| 8 | { |
| 9 | class Heap; |
| 10 | |
| 11 | class HeapArray |
| 12 | { |
| 13 | public: |
| 14 | Heap* getHeap(s32 index) const |
| 15 | { |
| 16 | if (index < HeapMgr::getRootHeapNum()) |
| 17 | return mHeaps[index]; |
| 18 | return mHeaps[0]; |
| 19 | } |
| 20 | |
| 21 | Heap* getPrimaryHeap() const { return mHeaps[mPrimaryIndex]; } |
| 22 | |
| 23 | Heap* mHeaps[4]; |
| 24 | bool mAdjusted[4]{}; |
| 25 | s32 mPrimaryIndex{}; |
| 26 | }; |
| 27 | |
| 28 | struct HeapPolicy |
| 29 | { |
| 30 | Heap* parent{}; |
| 31 | u32 size{}; |
| 32 | u32 create_slack{}; |
| 33 | u32 adjust_slack{}; |
| 34 | u8 adjust{}; |
| 35 | u8 temporary{}; |
| 36 | u8 dont_create{}; |
| 37 | }; |
| 38 | |
| 39 | struct HeapPolicies |
| 40 | { |
| 41 | HeapPolicy mPolicies[4]; |
| 42 | s32 mPrimaryIndex{}; |
| 43 | }; |
| 44 | |
| 45 | } // namespace sead |
| 46 | |
| 47 | #endif // SEAD_HEAP_POLICIES_H_ |
| 48 | |