From f12c5050f3b8d627e339d78fc5aa148915412070 Mon Sep 17 00:00:00 2001 From: Pheenoh Date: Sun, 3 Jan 2021 16:34:11 -0500 Subject: [PATCH] HeapCheck::heapDisplay OK --- include/JSystem/JKernel/JKRExpHeap/JKRExpHeap.h | 2 ++ src/m_Do/m_Do_main.cpp | 16 ++++------------ 2 files changed, 6 insertions(+), 12 deletions(-) diff --git a/include/JSystem/JKernel/JKRExpHeap/JKRExpHeap.h b/include/JSystem/JKernel/JKRExpHeap/JKRExpHeap.h index bbe1705db84..72b16a4c5b4 100644 --- a/include/JSystem/JKernel/JKRExpHeap/JKRExpHeap.h +++ b/include/JSystem/JKernel/JKRExpHeap/JKRExpHeap.h @@ -28,6 +28,8 @@ public: CMemBlock* getNextBlock() { return this->mNext; } + u32 getSize() { return this->size; } + private: u16 mMagic; u8 mFlags; // a|bbbbbbb a=temporary b=alignment diff --git a/src/m_Do/m_Do_main.cpp b/src/m_Do/m_Do_main.cpp index 3d0babdfa87..d558e5e4fc9 100644 --- a/src/m_Do/m_Do_main.cpp +++ b/src/m_Do/m_Do_main.cpp @@ -75,15 +75,13 @@ s32 HeapCheck::getUsedCount(void) const { return countUsed(this->heap); } -// 1 instruction off -#ifdef NONMATCHING void HeapCheck::heapDisplay(void) const { - u32 heap_size1 = heap->heap_size; - s32 heap_size2 = this->heap->heap_size - this->heap_size; + s32 heap_size1 = this->heap->getSize(); + s32 heap_size2 = heap_size1 - this->heap_size; s32 heap_total_used_size = this->heap->getTotalUsedSize(); - s32 heap_total_free_size = ((JKRHeap*)this->heap)->getTotalFreeSize(); - s32 heap_free_size = ((JKRHeap*)this->heap)->getFreeSize(); + s32 heap_total_free_size = this->heap->getTotalFreeSize(); + s32 heap_free_size = this->heap->getFreeSize(); JUTReport__FiiPCce(0x64, 0xd4, lbl_803739A0 + 0x3C, this->names[0]); JUTReport__FiiPCce(0x64, 0xe3, lbl_803739A0 + 0x45, heap_size1); @@ -102,12 +100,6 @@ void HeapCheck::heapDisplay(void) const { heap_size2 = countUsed(this->heap); JUTReport__FiiPCce(0x64, 0x165, lbl_803739A0 + 0x133, heap_size2); } -#else -asm void HeapCheck::heapDisplay(void) const { - nofralloc -#include "m_Do\m_Do_main\asm\func_800058C4.s" -} -#endif asm void debugDisplay(void) { nofralloc