2018-11-29 11:24:28 +00:00
|
|
|
#ifndef GUARD_ALLOC_H
|
|
|
|
#define GUARD_ALLOC_H
|
2017-09-01 14:53:06 +00:00
|
|
|
|
2017-11-13 04:16:51 +00:00
|
|
|
#define HEAP_SIZE 0x1C000
|
2017-09-07 18:31:23 +00:00
|
|
|
#define free Free
|
2017-09-16 02:12:45 +00:00
|
|
|
|
2017-11-02 17:19:49 +00:00
|
|
|
#define FREE_AND_SET_NULL(ptr) \
|
|
|
|
{ \
|
|
|
|
free(ptr); \
|
|
|
|
ptr = NULL; \
|
|
|
|
}
|
|
|
|
|
2021-01-19 09:03:51 +00:00
|
|
|
#define TRY_FREE_AND_SET_NULL(ptr) if (ptr != NULL) FREE_AND_SET_NULL(ptr)
|
|
|
|
|
2017-09-20 01:00:24 +00:00
|
|
|
extern u8 gHeap[];
|
2018-10-14 18:00:14 +00:00
|
|
|
|
2017-09-01 14:53:06 +00:00
|
|
|
void *Alloc(u32 size);
|
|
|
|
void *AllocZeroed(u32 size);
|
|
|
|
void Free(void *pointer);
|
2017-09-16 02:12:45 +00:00
|
|
|
void InitHeap(void *pointer, u32 size);
|
2017-09-01 14:53:06 +00:00
|
|
|
|
2018-11-29 11:24:28 +00:00
|
|
|
#endif // GUARD_ALLOC_H
|