diff options
Diffstat (limited to 'include/SDK/OS/OSAlloc.h')
-rw-r--r-- | include/SDK/OS/OSAlloc.h | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/include/SDK/OS/OSAlloc.h b/include/SDK/OS/OSAlloc.h index 150a5f8..a8714eb 100644 --- a/include/SDK/OS/OSAlloc.h +++ b/include/SDK/OS/OSAlloc.h @@ -5,6 +5,13 @@ extern "C" { #endif + +#if 0 +extern volatile OSHeapHandle __OSCurrHeap; // used in OSInitAlloc +#endif + +typedef s32 OSHeapHandle; + typedef struct Cell Cell; struct Cell { @@ -13,7 +20,23 @@ struct Cell { 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); #ifdef __cplusplus } |