From 4a595fba931cd9f2dd862e9573f5cac5de1951ee Mon Sep 17 00:00:00 2001 From: James Benton Date: Sun, 9 Oct 2016 21:16:40 +0100 Subject: [PATCH] coreinit: Fill out MEMUnitHeap structure. --- include/coreinit/filesystem.h | 2 +- include/coreinit/unitheap.h | 17 ++++++++++++++++- 2 files changed, 17 insertions(+), 2 deletions(-) diff --git a/include/coreinit/filesystem.h b/include/coreinit/filesystem.h index 363bf11..2ef8850 100644 --- a/include/coreinit/filesystem.h +++ b/include/coreinit/filesystem.h @@ -11,7 +11,7 @@ * want to run in parallel. You must ensure the previous filesystem command * has been completed before reusing the same FSCmdBlock, you do not need to * reinitialise an FSCmdBlock before reusing it. - * + * * Calling fsDevInit initializes the stdlib devoptab, allowing for standard * file IO. * @{ diff --git a/include/coreinit/unitheap.h b/include/coreinit/unitheap.h index dc827bc..549a0c1 100644 --- a/include/coreinit/unitheap.h +++ b/include/coreinit/unitheap.h @@ -1,5 +1,6 @@ #pragma once #include +#include "memheap.h" /** * \defgroup coreinit_unitheap Unit Heap @@ -12,11 +13,25 @@ extern "C" { #endif typedef struct MEMUnitHeap MEMUnitHeap; +typedef struct MEMUnitHeapFreeBlock MEMUnitHeapFreeBlock; + +struct MEMUnitHeapFreeBlock +{ + MEMUnitHeapFreeBlock *next; +}; +CHECK_OFFSET(MEMUnitHeapFreeBlock, 0x00, next); +CHECK_SIZE(MEMUnitHeapFreeBlock, 0x04); struct MEMUnitHeap { + MEMHeapHeader header; + MEMUnitHeapFreeBlock *freeBlocks; + uint32_t blockSize; }; -UNKNOWN_SIZE(MEMUnitHeap); +CHECK_OFFSET(MEMUnitHeap, 0x00, header); +CHECK_OFFSET(MEMUnitHeap, 0x40, freeBlocks); +CHECK_OFFSET(MEMUnitHeap, 0x44, blockSize); +CHECK_SIZE(MEMUnitHeap, 0x48); MEMUnitHeap * MEMCreateUnitHeapEx(MEMUnitHeap *heap,