diff options
author | PikalaxALT <pikalaxalt@gmail.com> | 2019-09-08 21:07:54 -0400 |
---|---|---|
committer | PikalaxALT <pikalaxalt@gmail.com> | 2019-09-08 21:07:54 -0400 |
commit | 306ce048ad07d62bed2028bfc8f30c03f5bc8db7 (patch) | |
tree | 09dada0db49517542634aaf4058a613b350c9feb /gflib/malloc.h | |
parent | 95b805a425844175663f7f10b1b92df690a8b2c0 (diff) |
Move gflib srcs and headers to gflib subdir
Diffstat (limited to 'gflib/malloc.h')
-rw-r--r-- | gflib/malloc.h | 22 |
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 |