From d92409f5514647de54a0146203735d2d4453b9b6 Mon Sep 17 00:00:00 2001 From: John Hodge Date: Sat, 7 Sep 2013 23:02:27 +0800 Subject: [PATCH] Usermode/libc - Minor cleanup to heap --- Usermode/Libraries/libc.so_src/heap.c | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/Usermode/Libraries/libc.so_src/heap.c b/Usermode/Libraries/libc.so_src/heap.c index 1c0c7acf..3cbd0b53 100644 --- a/Usermode/Libraries/libc.so_src/heap.c +++ b/Usermode/Libraries/libc.so_src/heap.c @@ -453,17 +453,15 @@ void Heap_Dump(void) heap_head *cur = _heap_start; while( cur < (heap_head*)_heap_end ) { - switch( cur->magic ) - { - case MAGIC: + if( cur->magic == MAGIC ) { _SysDebug("Used block %p[0x%x] - ptr=%p", cur, cur->size, cur->data); - break; - case MAGIC_FREE: + } + else if( cur->magic == MAGIC_FREE ) { _SysDebug("Free block %p[0x%x] - ptr=%p", cur, cur->size, cur->data); - break; - default: + } + else { _SysDebug("Block %p bad magic (0x%x)", cur, cur->magic); - return ; + break ; } cur = (void*)( (char*)cur + cur->size ); } -- 2.20.1