NSMBW-Decomp
A decompilation of New Super Mario Bros. Wii
Loading...
Searching...
No Matches
eggHeap.h
1
#pragma once
2
#include <lib/rvl/mem/MEMHeapCommon.h>
3
#include <lib/egg/core/eggDisposer.h>
4
5
// [TODO: extend this]
6
7
namespace
EGG {
8
class
Allocator
;
9
class
FrmHeap
;
10
11
class
Heap : Disposer {
12
public
:
13
Heap() : mFlag(0) {}
14
Heap(
MEMiHeapHead
*heapHead);
15
virtual
~Heap();
16
// [TODO: this is likely an enum]
17
virtual
int
getHeapKind()
const
= 0;
18
virtual
void
initAllocator(
Allocator
* allocator,
long
align) = 0;
19
virtual
void
*alloc(
size_t
,
long
) = 0;
20
virtual
void
free(
void
*) = 0;
21
virtual
void
destroy() = 0;
22
23
static
void
*alloc(
size_t
,
int
,
EGG::Heap
*);
24
static
void
free(
void
*,
EGG::Heap
*);
25
26
char
mPad1[0x8];
// [TODO: Remove this padding when Disposer's link is added]
27
MEMiHeapHead
*mHeapHandle;
28
void
*mHeapBuffer;
29
Heap *mParentHeap;
30
u16 mFlag;
// [TODO: TBitFlag<u16>]
31
u8 mPad2[0x18];
32
33
static
FrmHeap
*dynamicCastToFrm(Heap *heap) {
34
if
(heap !=
nullptr
&& heap->getHeapKind() == 2) {
35
return
(
FrmHeap
*) heap;
36
}
37
return
nullptr
;
38
}
39
40
static
Heap *sCurrentHeap;
41
};
42
}
43
44
void
*
operator
new
(size_t,
void
*);
45
void
*
operator
new
(size_t, int);
46
void
*
operator
new
(size_t,
EGG::Heap
*, int);
47
void
*
operator
new
[](size_t,
EGG::Heap
*, int);
EGG::Allocator
Definition
eggAllocator.h:7
EGG::FrmHeap
Definition
eggFrmHeap.h:9
EGG::Heap
Definition
eggHeap.h:11
MEMiHeapHead
Definition
MEMHeapCommon.h:11
include
lib
egg
core
eggHeap.h
Made with ❤️ by
CLF78
and
RootCubed
. Logos by
Chasical
and
B1
. Website generated by
Doxygen
1.13.2