summaryrefslogtreecommitdiff
path: root/include/SDK/OS/OSAlloc.h
diff options
context:
space:
mode:
authorMax <mparisi@stevens.edu>2020-09-15 11:45:38 -0400
committerMax <mparisi@stevens.edu>2020-09-15 11:45:38 -0400
commitadc235826d66553dfb1eb4286430aac4810bc991 (patch)
tree81e78d1060c71e33b3686247f25067eb7692bf87 /include/SDK/OS/OSAlloc.h
parent1847436ad5b191a5ff00a468768bcbd6c6f1d710 (diff)
OSAlloc.c need to fixed offsets to global static data, then it will match
Diffstat (limited to 'include/SDK/OS/OSAlloc.h')
-rw-r--r--include/SDK/OS/OSAlloc.h21
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);