]> granicus.if.org Git - gc/commitdiff
Code refactoring of divide-by-HBLKSIZE occurrences
authorIvan Maidanski <ivmai@mail.ru>
Tue, 27 Sep 2016 07:55:27 +0000 (10:55 +0300)
committerIvan Maidanski <ivmai@mail.ru>
Tue, 27 Sep 2016 07:55:27 +0000 (10:55 +0300)
* alloc.c (GC_print_heap_sects): Replace "/HBLKSIZE" with divHBLKSZ.
* blacklst.c (total_stack_black_listed): Likewise.

alloc.c
blacklst.c

diff --git a/alloc.c b/alloc.c
index 6ecbe8d230f7cdbb0bab9ed02c3d330fca4c3ea7..d3f5943ef9bd48ad86b2aeaf6b15b48a7dd35d42 100644 (file)
--- 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
index dcac51a7af3a7bffd9949ac5d994d7317f75d1bf..d080944e332a656420ac902e0676c827505873f3 100644 (file)
@@ -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);
     }