summaryrefslogtreecommitdiff
path: root/arm9/lib/include/NNS_FND_allocator.h
diff options
context:
space:
mode:
authorAkira Akashi <rubenru09@aol.com>2021-06-03 02:48:35 +0100
committerGitHub <noreply@github.com>2021-06-03 02:48:35 +0100
commit33a7ec1fd719b9321357aa59460cbdb9f7779053 (patch)
tree993c0c156f6a3c310cccd2a3e0ac802b59ab149e /arm9/lib/include/NNS_FND_allocator.h
parent7e32d3758e7e36d7a67a1442cdb9386f9aa18a6e (diff)
parent6e3af5fa580d0f6aca3bb310d979323bf2a09a84 (diff)
Merge pull request #400 from PikalaxALT/doc_heap_etc
SDK-informed refactoring
Diffstat (limited to 'arm9/lib/include/NNS_FND_allocator.h')
-rw-r--r--arm9/lib/include/NNS_FND_allocator.h34
1 files changed, 34 insertions, 0 deletions
diff --git a/arm9/lib/include/NNS_FND_allocator.h b/arm9/lib/include/NNS_FND_allocator.h
new file mode 100644
index 00000000..48df282a
--- /dev/null
+++ b/arm9/lib/include/NNS_FND_allocator.h
@@ -0,0 +1,34 @@
+#ifndef GUARD_NNS_FND_ALLOCATOR_H
+#define GUARD_NNS_FND_ALLOCATOR_H
+
+#include "NNS_FND_heapcommon.h"
+
+typedef struct NNSFndAllocator NNSFndAllocator;
+
+typedef void* (*NNSFndFuncAllocatorAlloc)(
+ NNSFndAllocator* pAllocator,
+ u32 size);
+
+typedef void (*NNSFndFuncAllocatorFree)(
+ NNSFndAllocator* pAllocator,
+ void* memBlock);
+
+typedef struct NNSFndAllocatorFunc NNSFndAllocatorFunc;
+
+struct NNSFndAllocatorFunc
+{
+ NNSFndFuncAllocatorAlloc pfAlloc;
+ NNSFndFuncAllocatorFree pfFree;
+};
+
+struct NNSFndAllocator
+{
+ NNSFndAllocatorFunc const * pFunc;
+ void* pHeap;
+ u32 heapParam1;
+ u32 heapParam2;
+};
+
+void NNS_FndInitAllocatorForExpHeap(NNSFndAllocator * pAllocator, NNSFndHeapHandle heap, int alignment);
+
+#endif //GUARD_NNS_FND_ALLOCATOR_H