diff options
author | PikalaxALT <pikalaxalt@gmail.com> | 2020-04-30 20:13:36 -0400 |
---|---|---|
committer | PikalaxALT <pikalaxalt@gmail.com> | 2020-04-30 20:13:36 -0400 |
commit | 6c3731902319116e8e73b14e2b75d5fd8c9642ff (patch) | |
tree | 72b3ac0553ea193e69c70325bcdb5579d263e211 /arm9/lib/include/os_alloc.h | |
parent | 70dcdeff9aaeae583be70cdd7371b6b8a5fe6076 (diff) | |
parent | 081bd6efce613ed078407ab8fd24765275385f9f (diff) |
Merge branch 'master' of https://github.com/martmists/pokediamond into pikalax_work
Diffstat (limited to 'arm9/lib/include/os_alloc.h')
-rw-r--r-- | arm9/lib/include/os_alloc.h | 38 |
1 files changed, 38 insertions, 0 deletions
diff --git a/arm9/lib/include/os_alloc.h b/arm9/lib/include/os_alloc.h new file mode 100644 index 00000000..1c4b6122 --- /dev/null +++ b/arm9/lib/include/os_alloc.h @@ -0,0 +1,38 @@ +// +// Created by mart on 4/23/20. +// + +#ifndef POKEDIAMOND_OS_ALLOC_H +#define POKEDIAMOND_OS_ALLOC_H + +#include "types.h" +#include "os_arena.h" + +typedef int OSHeapHandle; + +typedef struct Cell Cell; + +struct Cell { + Cell* prev; + Cell* next; + long size; +}; + +typedef struct { + long size; + Cell *free; + Cell *allocated; +} HeapDesc; + +typedef struct { + volatile OSHeapHandle currentHeap; + int numHeaps; + void* arenaStart; + void* arenaEnd; + HeapDesc* heapArray; +} OSHeapInfo; + +void OS_FreeToHeap(OSArenaId id, OSHeapHandle heap, void *ptr); +void* OS_AllocFromHeap(OSArenaId id, OSHeapHandle heap, u32 size); + +#endif //POKEDIAMOND_OS_ALLOC_H |