From 145c375f7423cd777cc0ef0effa38b64372efbda Mon Sep 17 00:00:00 2001 From: Ivan Maidanski Date: Tue, 27 Sep 2016 10:55:27 +0300 Subject: [PATCH] Code refactoring of divide-by-HBLKSIZE occurrences * alloc.c (GC_print_heap_sects): Replace "/HBLKSIZE" with divHBLKSZ. * blacklst.c (total_stack_black_listed): Likewise. --- alloc.c | 2 +- blacklst.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/alloc.c b/alloc.c index 6ecbe8d2..d3f5943e 100644 --- a/alloc.c +++ b/alloc.c @@ -1207,7 +1207,7 @@ GC_INNER void GC_add_to_heap(struct hblk *p, size_t bytes) } GC_printf("Section %d from %p to %p %lu/%lu blacklisted\n", i, start, start + len, - (unsigned long)nbl, (unsigned long)(len/HBLKSIZE)); + (unsigned long)nbl, (unsigned long)divHBLKSZ(len)); } } #endif diff --git a/blacklst.c b/blacklst.c index dcac51a7..d080944e 100644 --- a/blacklst.c +++ b/blacklst.c @@ -281,7 +281,7 @@ static word total_stack_black_listed(void) for (i = 0; i < GC_n_heap_sects; i++) { struct hblk * start = (struct hblk *) GC_heap_sects[i].hs_start; - struct hblk * endp1 = start + GC_heap_sects[i].hs_bytes/HBLKSIZE; + struct hblk * endp1 = start + divHBLKSZ(GC_heap_sects[i].hs_bytes); total += GC_number_stack_black_listed(start, endp1); } -- 2.50.1