diff options
Diffstat (limited to 'include/SDK/OS/OSAlloc.h')
-rw-r--r-- | include/SDK/OS/OSAlloc.h | 21 |
1 files changed, 19 insertions, 2 deletions
diff --git a/include/SDK/OS/OSAlloc.h b/include/SDK/OS/OSAlloc.h index 10edb01..0c583e8 100644 --- a/include/SDK/OS/OSAlloc.h +++ b/include/SDK/OS/OSAlloc.h @@ -5,19 +5,36 @@ extern "C" { #endif -typedef struct Cell Cell; -typedef int OSHeapHandle; #if 0 extern volatile OSHeapHandle __OSCurrHeap; // used in OSInitAlloc #endif +typedef s32 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; + + Cell *DLInsert(Cell *original, Cell *inserted); void *OSAllocFromHeap(OSHeapHandle heap, u32 size); void OSFreeToHeap(OSHeapHandle heap, void *ptr); |