summaryrefslogtreecommitdiff
path: root/arm9/lib/src/custom_allocator.c
diff options
context:
space:
mode:
Diffstat (limited to 'arm9/lib/src/custom_allocator.c')
-rw-r--r--arm9/lib/src/custom_allocator.c32
1 files changed, 0 insertions, 32 deletions
diff --git a/arm9/lib/src/custom_allocator.c b/arm9/lib/src/custom_allocator.c
deleted file mode 100644
index 283c3500..00000000
--- a/arm9/lib/src/custom_allocator.c
+++ /dev/null
@@ -1,32 +0,0 @@
-#include "custom_allocator.h"
-
-#include "global.h"
-#include "OS_alloc.h"
-
-static FreeFunc sDestructor;
-static AllocFunc sAllocator;
-
-// Custom allocator
-ARM_FUNC void* CallCustomAllocator(u32 size)
-{
- if (sAllocator != NULL)
- return sAllocator(size);
- else
- return OS_AllocFromHeap(OS_ARENA_MAIN, -1, size);
-}
-
-// Custom destructor
-ARM_FUNC void CallCustomDestructor(void * ptr)
-{
- if (sDestructor != NULL)
- sDestructor(ptr);
- else
- OS_FreeToHeap(OS_ARENA_MAIN, -1, ptr);
-}
-
-// Custom alloc/free setter
-ARM_FUNC void SetCustomAllocatorAndDestructor(AllocFunc allocator, FreeFunc destructor)
-{
- sAllocator = allocator;
- sDestructor = destructor;
-}