summaryrefslogtreecommitdiff
path: root/include/malloc.h
diff options
context:
space:
mode:
authoritskobold <itskobold@users.noreply.github.com>2017-11-15 12:41:25 +0000
committeritskobold <itskobold@users.noreply.github.com>2017-11-15 12:41:25 +0000
commit2acab81713aac51f96a50dc42a67ec7761901aa4 (patch)
treec39251dc3e6eb2f7cc884cbe4953b8c34dce8423 /include/malloc.h
parente373cf4bb9217eb5e4edba08c7cb95ecc895b821 (diff)
parent72b57b342eaf6e4a3ea77fae8b40e4ab11c64ae2 (diff)
Merge branch 'master' of https://github.com/pret/pokeemerald
also started fixing pointers in my dumps
Diffstat (limited to 'include/malloc.h')
-rw-r--r--include/malloc.h6
1 files changed, 6 insertions, 0 deletions
diff --git a/include/malloc.h b/include/malloc.h
index f3a731797..003ee1f03 100644
--- a/include/malloc.h
+++ b/include/malloc.h
@@ -5,6 +5,12 @@
#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);