Kinoko
A reimplementation of Mario Kart Wii's physics engine in C++
Toggle main menu visibility
Loading...
Searching...
No Matches
ExpHeap.hh
1
#pragma once
2
3
#include "egg/core/Heap.hh"
4
5
#include <abstract/memory/ExpHeap.hh>
6
7
namespace
Kinoko::EGG
{
8
15
class
ExpHeap :
public
Heap {
16
public
:
21
class
GroupSizeRecord {
22
public
:
23
GroupSizeRecord();
24
void
reset();
25
[[nodiscard]]
size_t
getGroupSize(u16 groupID)
const
;
26
void
addSize(u16 groupID,
size_t
size);
27
28
[[nodiscard]]
constexpr
size_t
size()
const
{
29
return
m_entries.size();
30
}
31
32
private
:
33
std::array<size_t, 256> m_entries;
34
};
35
36
~ExpHeap()
override
;
37
void
destroy()
override
;
38
40
[[nodiscard]] Kind getHeapKind()
const override
{
41
return
Heap::Kind::Expanded;
42
}
43
44
[[nodiscard]]
void
*alloc(
size_t
size, s32 align)
override
;
45
void
free(
void
*block)
override
;
46
[[nodiscard]] u32 getAllocatableSize(s32 align = 4)
const override
;
47
48
static
void
addGroupSize(
void
*block,
Abstract::Memory::MEMiHeapHead
*heap, uintptr_t param);
49
void
calcGroupSize(GroupSizeRecord *record);
50
51
void
setGroupID(u16 groupID);
52
[[nodiscard]] u16 getGroupID()
const
;
53
54
[[nodiscard]]
Abstract::Memory::MEMiExpHeapHead
*dynamicCastHandleToExp();
55
[[nodiscard]]
const
Abstract::Memory::MEMiExpHeapHead
*dynamicCastHandleToExp()
const
;
56
57
[[nodiscard]]
static
ExpHeap
*create(
void
*startAddress,
size_t
size, u16 opt);
58
[[nodiscard]]
static
ExpHeap
*create(
size_t
size,
Heap
*heap, u16 opt);
59
60
private
:
61
ExpHeap
(
Abstract::Memory::MEMiHeapHead
*handle);
62
};
63
64
}
// namespace Kinoko::EGG
Kinoko::Abstract::Memory::MEMiExpHeapHead
Low-level implementation of a memory heap for managing dynamic memory allocation. Allocation may occu...
Definition
ExpHeap.hh:72
Kinoko::Abstract::Memory::MEMiHeapHead
A low-level representation of a memory heap for managing dynamic memory allocation....
Definition
HeapCommon.hh:21
Kinoko::EGG::ExpHeap
High-level implementation of a memory heap for managing dynamic memory allocation....
Definition
ExpHeap.hh:15
Kinoko::EGG::Heap
A high-level representation of a memory heap for managing dynamic memory allocation....
Definition
Heap.hh:24
Kinoko::EGG
EGG core library.
Definition
Archive.cc:6
egg
core
ExpHeap.hh
Made by
Malleo
. Logo by
vabold
. Website generated by
Doxygen
1.17.0