about summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorptitSeb <sebastien.chev@gmail.com>2025-03-31 13:13:48 +0200
committerptitSeb <sebastien.chev@gmail.com>2025-03-31 13:13:48 +0200
commit1c3df4b92cd975687c466aed7b2d1e5a474aaa7d (patch)
treeee810f0b0453f2b3dda44539581373053be01164
parentb1ba548d62983ee23e3a3b2ea57da5d8a7ee669d (diff)
downloadbox64-1c3df4b92cd975687c466aed7b2d1e5a474aaa7d.tar.gz
box64-1c3df4b92cd975687c466aed7b2d1e5a474aaa7d.zip
[DEBUG] Fixed debug tool testAllBlocks() to correctly handle new map128 custom alloc
-rw-r--r--src/custommem.c17
1 files changed, 12 insertions, 5 deletions
diff --git a/src/custommem.c b/src/custommem.c
index ed77c017..6b1eb6e9 100644
--- a/src/custommem.c
+++ b/src/custommem.c
@@ -392,12 +392,12 @@ void testAllBlocks()
                 printBlock(p_blocks[i].block, p_blocks[i].first);
             total += p_blocks[i].size;
             if(is32bits) total32 += p_blocks[i].size;
-            if(max_free<p_blocks[i].maxfree)
-                max_free = p_blocks[i].maxfree;
-            if(is32bits && max_free32<p_blocks[i].maxfree)
-                max_free32 = p_blocks[i].maxfree;
             if(p_blocks[i].type==BTYPE_LIST) {
-            blockmark_t* m = (blockmark_t*)p_blocks[i].block;
+                if(max_free<p_blocks[i].maxfree)
+                    max_free = p_blocks[i].maxfree;
+                if(is32bits && max_free32<p_blocks[i].maxfree)
+                    max_free32 = p_blocks[i].maxfree;
+                blockmark_t* m = (blockmark_t*)p_blocks[i].block;
                 while(m->next.x32) {
                     if(!m->next.fill)
                         fragmented_free += SIZE_BLOCK(m->next);
@@ -405,6 +405,13 @@ void testAllBlocks()
                         fragmented_free32 += SIZE_BLOCK(m->next);
                     m = NEXT_BLOCK(m);
                 }
+            } else {
+                if(p_blocks[i].maxfree) {
+                    if(max_free<128) max_free=128;
+                    if(is32bits && max_free32<128) max_free32=128;
+                    fragmented_free += p_blocks[i].maxfree;
+                    if(is32bits) fragmented_free32 += p_blocks[i].maxfree;
+                }
             }
         }
     }