summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorPheenoh <pheenoh@gmail.com>2021-01-03 16:58:49 -0500
committerPheenoh <pheenoh@gmail.com>2021-01-03 16:58:49 -0500
commitd8fdc85090226dcaf7309102d386bf37db3ff284 (patch)
tree3e0611c9633430efc70bf85830157704b04b6c4b /src
parentf12c5050f3b8d627e339d78fc5aa148915412070 (diff)
countUsed OK
Diffstat (limited to 'src')
-rw-r--r--src/m_Do/m_Do_main.cpp15
1 files changed, 13 insertions, 2 deletions
diff --git a/src/m_Do/m_Do_main.cpp b/src/m_Do/m_Do_main.cpp
index d558e5e4fc..a9848ccc99 100644
--- a/src/m_Do/m_Do_main.cpp
+++ b/src/m_Do/m_Do_main.cpp
@@ -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 {