summaryrefslogtreecommitdiff
path: root/src/egg/core/eggAllocator.cpp
diff options
context:
space:
mode:
authorrobojumper <robojumper@gmail.com>2025-06-30 23:41:35 +0200
committerGitHub <noreply@github.com>2025-06-30 23:41:35 +0200
commitac1da51c33ef1ffa664b79a2ff90367d6cab0530 (patch)
tree87d514f927c1939023fceb91f838dddd87420c5d /src/egg/core/eggAllocator.cpp
parent2874153333f72035935e0ab1ba60c1b5ae50eec3 (diff)
parenta8e9c4c3452556aada4dcabaf4d62b31a00a11cb (diff)
Merge pull request #209 from robojumper/egg-symbols-maintenance
EGG symbols maintenance
Diffstat (limited to 'src/egg/core/eggAllocator.cpp')
-rw-r--r--src/egg/core/eggAllocator.cpp17
1 files changed, 8 insertions, 9 deletions
diff --git a/src/egg/core/eggAllocator.cpp b/src/egg/core/eggAllocator.cpp
index d12d57a8..22780acf 100644
--- a/src/egg/core/eggAllocator.cpp
+++ b/src/egg/core/eggAllocator.cpp
@@ -2,23 +2,22 @@
#include "egg/core/eggHeap.h"
-
-/* 804952d0 */ static void *MEM_AllocFor_Heap(MEMAllocator *alloc, u32 size) {
+/* 804952d0 */ static void *AllocatorAllocForHeap_(MEMAllocator *alloc, u32 size) {
return static_cast<EGG::Heap *>(static_cast<EGG::Allocator *>(alloc)->heap)->alloc(size, alloc->heapParam1);
}
-/* 804952f0 */ static void MEM_FreeFor_Heap(MEMAllocator *alloc, void *block) {
+/* 804952f0 */ static void AllocatorFreeForHeap_(MEMAllocator *alloc, void *block) {
return static_cast<EGG::Heap *>(static_cast<EGG::Allocator *>(alloc)->heap)->free(block);
}
-const MEMAllocatorFuncs eggAllocatorFuncs = {
- &MEM_AllocFor_Heap,
- &MEM_FreeFor_Heap,
-};
-
// TODO this is used from eggHeap for some reason. Figure out
// the correct privacy boundary later.
/* 80495310 */ void MEMInitAllocatorFor_Heap(MEMAllocator *alloc, s32 align, void *heap) {
- alloc->funcs = &eggAllocatorFuncs;
+ static const MEMAllocatorFuncs sAllocatorFunc = {
+ &AllocatorAllocForHeap_,
+ &AllocatorFreeForHeap_,
+ };
+
+ alloc->funcs = &sAllocatorFunc;
alloc->heap = heap;
alloc->heapParam1 = align;
alloc->heapParam2 = 0;