From 78e4c652321b99db9784f18451e2ab5b818db009 Mon Sep 17 00:00:00 2001 From: Martin Quinson Date: Sun, 10 Sep 2017 15:19:55 +0200 Subject: [PATCH 1/1] please sonar: kill dead code --- src/xbt/mmalloc/mm_module.c | 29 ----------------------------- src/xbt/mmalloc/mmprivate.h | 2 -- 2 files changed, 31 deletions(-) diff --git a/src/xbt/mmalloc/mm_module.c b/src/xbt/mmalloc/mm_module.c index 6c04fdfa84..ec21f2d7df 100644 --- a/src/xbt/mmalloc/mm_module.c +++ b/src/xbt/mmalloc/mm_module.c @@ -381,32 +381,3 @@ ssize_t mmalloc_get_busy_size(xbt_mheap_t heap, void *ptr){ } } - -void mmcheck(xbt_mheap_t heap) {return; - if (!heap->heapinfo) - return; - malloc_info* heapinfo = NULL; - for (size_t i=1; i < heap->heaplimit; i += mmalloc_get_increment(heapinfo)) { - heapinfo = heap->heapinfo + i; - switch (heapinfo->type) { - case MMALLOC_TYPE_HEAPINFO: - case MMALLOC_TYPE_FREE: - if (heapinfo->free_block.size==0) { - xbt_die("Block size == 0"); - } - break; - case MMALLOC_TYPE_UNFRAGMENTED: - if (heapinfo->busy_block.size==0) { - xbt_die("Block size == 0"); - } - if (heapinfo->busy_block.busy_size==0 && heapinfo->busy_block.size!=0) { - xbt_die("Empty busy block"); - } - break; - default: - if (heapinfo->type<0) { - xbt_die("Unkown mmalloc block type."); - } - } - } -} diff --git a/src/xbt/mmalloc/mmprivate.h b/src/xbt/mmalloc/mmprivate.h index 93f925ab47..5e6609d9c1 100644 --- a/src/xbt/mmalloc/mmprivate.h +++ b/src/xbt/mmalloc/mmprivate.h @@ -310,8 +310,6 @@ static inline int mmalloc_get_increment(malloc_info* heapinfo) { } } -XBT_PRIVATE void mmcheck(xbt_mheap_t heap); - XBT_PRIVATE int malloc_use_mmalloc(void); XBT_PRIVATE int mmalloc_exec_using_mm(int argc, const char** argv); -- 2.20.1