summaryrefslogtreecommitdiff
path: root/include/JSystem/JAudio/JASHeapCtrl.h
blob: f800f16be376a4ddff55eee0e5555bcb38d57d2d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
#ifndef JASHEAPCTRL_H
#define JASHEAPCTRL_H

#include "JSystem/JSupport/JSUList.h"
#include "dolphin/os/OSMutex.h"

namespace JASystem {
    namespace Kernel {
        class TDisposer {
        public:
            virtual void onDispose() {}
        };

        class THeap {
        public:
            enum Type {
                Type0,
                Type1,
            };

            THeap(TDisposer*);
            ~THeap() {}
            void initRootHeap(void*, u32, Type);
            bool alloc(THeap*, u32);
            bool free();
            void insertChild(THeap* param_1, THeap* param_2, void* param_3, u32 param_4, bool param_5);
            JASystem::Kernel::THeap* getTailHeap();
            u32 getTailOffset();
            u32 getCurOffset();

            bool isAllocated() { return mBase; }

            /* 0x00 */ JSUTree<THeap> mTree;
            /* 0x1C */ OSMutex mMutex;
            /* 0x34 */ TDisposer* mDisposer;
            /* 0x38 */ Type mType;
            /* 0x3C */ u8* mBase;
            /* 0x40 */ u32 mSize;
            /* 0x44 */ THeap* field_0x44;
        };

        class TSolidHeap {
        public:
            TSolidHeap();
            ~TSolidHeap() {}
            void* alloc(s32 param_1);
            void freeAll();
            void init(u8* param_1, s32 param_2);
            int getRemain();

            /* 0x00 */ u32 field_0x0;
            /* 0x04 */ int field_0x4;
            /* 0x08 */ int field_0x8;
            /* 0x0C */ int field_0xc;
            /* 0x10 */ int field_0x10;
        };
    }
}

#endif /* JASHEAPCTRL_H */