summaryrefslogtreecommitdiff
path: root/gflib/malloc.h
diff options
context:
space:
mode:
Diffstat (limited to 'gflib/malloc.h')
-rw-r--r--gflib/malloc.h22
1 files changed, 22 insertions, 0 deletions
diff --git a/gflib/malloc.h b/gflib/malloc.h
new file mode 100644
index 000000000..f2dcf6d46
--- /dev/null
+++ b/gflib/malloc.h
@@ -0,0 +1,22 @@
+#ifndef GUARD_ALLOC_H
+#define GUARD_ALLOC_H
+
+#define HEAP_SIZE 0x1C000
+#define malloc Alloc
+#define calloc(ct, sz) AllocZeroed((ct) * (sz))
+#define free Free
+
+#define FREE_AND_SET_NULL(ptr) \
+{ \
+ free(ptr); \
+ ptr = NULL; \
+}
+
+extern u8 gHeap[];
+
+void *Alloc(u32 size);
+void *AllocZeroed(u32 size);
+void Free(void *pointer);
+void InitHeap(void *pointer, u32 size);
+
+#endif // GUARD_ALLOC_H