NSMBW-Decomp
A decompilation of New Super Mario Bros. Wii
Loading...
Searching...
No Matches
m_allocator.hpp
1
#pragma once
2
#include <types.h>
3
#include <game/mLib/m_heap.hpp>
4
#include <lib/egg/core/eggAllocator.h>
5
6
/**
7
* @brief An allocator class that wraps an EGG:Allocator .
8
*/
9
class
mAllocator_c
:
public
EGG::Allocator {
10
public
:
11
mAllocator_c
();
///< Constructs a new allocator.
12
virtual
~mAllocator_c
();
///< Destroys the allocator.
13
14
virtual
void
*alloc(
size_t
size);
15
virtual
void
free(
void
*ptr);
16
17
bool
attach(EGG::Heap *heap,
int
alignment);
18
19
static
void
init(EGG::Heap *heap);
20
};
21
22
/**
23
* @brief An allocator with some helper functions that manage the heap
24
* from which it allocates memory.
25
*/
26
class
mHeapAllocator_c
:
public
mAllocator_c
{
27
public
:
28
mHeapAllocator_c
();
///< Constructs a new heap allocator.
29
virtual
~mHeapAllocator_c
();
///< Destroys the heap allocator.
30
31
bool
createFrmHeap(
size_t
size, EGG::Heap *parent,
const
char
*name, ulong align, mHeap::AllocOptBit_t opt);
32
bool
createFrmHeapToCurrent(
size_t
size, EGG::Heap *parent,
const
char
*name, ulong align, mHeap::AllocOptBit_t opt);
33
34
void
destroyHeap
();
///< Destroys the underlying heap and replaces it with the dummy heap.
35
size_t
adjustFrmHeap();
36
size_t
adjustFrmHeapRestoreCurrent();
37
};
mAllocator_c::mAllocator_c
mAllocator_c()
Constructs a new allocator.
Definition
m_allocator.cpp:60
mAllocator_c::~mAllocator_c
virtual ~mAllocator_c()
Destroys the allocator.
Definition
m_allocator.cpp:63
mHeapAllocator_c::destroyHeap
void destroyHeap()
Destroys the underlying heap and replaces it with the dummy heap.
Definition
m_allocator.cpp:104
mHeapAllocator_c::~mHeapAllocator_c
virtual ~mHeapAllocator_c()
Destroys the heap allocator.
Definition
m_allocator.cpp:89
mHeapAllocator_c::mHeapAllocator_c
mHeapAllocator_c()
Constructs a new heap allocator.
Definition
m_allocator.cpp:87
include
game
mLib
m_allocator.hpp
Made with ❤️ by
CLF78
and
RootCubed
. Logos by
Chasical
and
B1
. Website generated by
Doxygen
1.15.0