From: Ivan Maidanski Date: Tue, 27 Sep 2016 07:55:27 +0000 (+0300) Subject: Code refactoring of divide-by-HBLKSIZE occurrences X-Git-Tag: v7.6.2~390 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=60c31d142c63b55c5e594be0fca4f8dafb192f7b;p=gc Code refactoring of divide-by-HBLKSIZE occurrences * alloc.c (GC_print_heap_sects): Replace "/HBLKSIZE" with divHBLKSZ. * blacklst.c (total_stack_black_listed): Likewise. --- diff --git a/alloc.c b/alloc.c index e9de9113..3da99025 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); }