diff options
author | garak <garakmon@gmail.com> | 2018-12-16 20:05:31 -0500 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-12-16 20:05:31 -0500 |
commit | e292d0ca8375a8c54907d6bcf404e2e084344156 (patch) | |
tree | b9c59449d47bf73d98d3e38fa26804a163d871ab /include/alloc.h | |
parent | 10237e8d13b35474ea999b4e9139f9a48a80c53d (diff) | |
parent | d1e6e705ccf05f93933ae4494b1d388550d81d26 (diff) |
Merge branch 'master' into fldeff
Diffstat (limited to 'include/alloc.h')
-rw-r--r-- | include/alloc.h | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/include/alloc.h b/include/alloc.h new file mode 100644 index 000000000..f2dcf6d46 --- /dev/null +++ b/include/alloc.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 |