countUsed OK

This commit is contained in:
Pheenoh 2021-01-03 16:58:49 -05:00
parent f12c5050f3
commit d8fdc85090
No known key found for this signature in database
GPG Key ID: 4312662758CE7D5A
2 changed files with 14 additions and 2 deletions

View File

@ -57,6 +57,7 @@ protected:
public:
s32 getUsedSize(u8) const;
s32 getTotalUsedSize(void) const;
CMemBlock* getHeadUsedList() { return mHeadUsedList; }
public:
/* vt[04] */ virtual u32 getHeapType(); /* override */

View File

@ -67,8 +67,19 @@ asm void CheckHeap(u32 param_1) {
}
#endif
asm int countUsed(JKRExpHeap* heap){nofralloc
#include "m_Do/m_Do_main/asm/func_80005848.s"
int countUsed(JKRExpHeap* heap) {
OSDisableScheduler();
int counter = 0;
JKRExpHeap::CMemBlock* used_blocks_head = heap->getHeadUsedList();
while (used_blocks_head) {
used_blocks_head = used_blocks_head->getNextBlock();
counter++;
};
OSEnableScheduler();
return counter;
}
s32 HeapCheck::getUsedCount(void) const {