From deca2b9bfc294138c4e95b26b4cae8de1ddd4ff5 Mon Sep 17 00:00:00 2001 From: 0x35c Date: Sat, 21 Sep 2024 12:19:04 +0200 Subject: [PATCH] fix: show_alloc_mem() can display detailed info properly --- src/memory/alloc/info.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/memory/alloc/info.c b/src/memory/alloc/info.c index 3e13483..3e796ba 100644 --- a/src/memory/alloc/info.c +++ b/src/memory/alloc/info.c @@ -2,7 +2,7 @@ #include "kprintf.h" // FULL_INFO is to display (or not) both used and unused blocks -#define FULL_INFO 0 +#define FULL_INFO 1 void show_alloc_mem(void) { @@ -14,19 +14,19 @@ void show_alloc_mem(void) for (Zone *zone_it = zones[type]; zone_it != NULL; zone_it = zone_it->next) { #if FULL_INFO - if (zone_it->kfree) + if (zone_it->free) kprintf("---------- AVAILABLE %s [n°%d - %p] " "----------\n", zones_name[type], count, zone_it); - for (Block *block_it = zone_it->kfree; block_it != NULL; - block_it = block_it->next_kfree) { + for (Block *block_it = zone_it->free; block_it != NULL; + block_it = block_it->next_free) { kprintf("%p - %p : %u bytes\n", block_it->ptr, (size_t)block_it->ptr + block_it->sub_size + sizeof(Block), block_it->sub_size); } - if (zone_it->kfree) - ft_printf("\n"); + if (zone_it->free) + kprintf("\n"); #endif if (zone_it->used) kprintf("---------- IN_USE %s [n°%d - %p] "