Skip to content

Commit 6a1bb7c

Browse files
committed
Use OSAlloc_NumHeaps when looping through the heaps
1 parent 455ab9e commit 6a1bb7c

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

ttyd-tools/rel/source/main.cpp

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -515,9 +515,12 @@ void checkHeaps()
515515
char *tempDisplayBuffer = DisplayBuffer;
516516

517517
// Check the standard heaps
518-
for (int32_t i = 0; i < 5; i++)
518+
int32_t TotalHeaps = gc::os::OSAlloc_NumHeaps;
519+
gc::os::HeapInfo *HeapArray = gc::os::OSAlloc_HeapArray;
520+
521+
for (int32_t i = 0; i < TotalHeaps; i++)
519522
{
520-
const gc::os::HeapInfo &heap = gc::os::OSAlloc_HeapArray[i];
523+
const gc::os::HeapInfo &heap = HeapArray[i];
521524
bool valid = true;
522525

523526
gc::os::ChunkInfo *currentChunk = nullptr;

0 commit comments

Comments
 (0)