From 192f4bfd2ffdaa5e6283bc16e8452fc3c218fb8a Mon Sep 17 00:00:00 2001 From: Leandro Lucarella Date: Sun, 29 Aug 2010 02:29:59 -0300 Subject: [PATCH] Use integer division to calculate the bit position Any decent compiler can optimize the division by a power of 2 to a shift. --- rt/gc/cdgc/gc.d | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/rt/gc/cdgc/gc.d b/rt/gc/cdgc/gc.d index 3122215..432aab9 100644 --- a/rt/gc/cdgc/gc.d +++ b/rt/gc/cdgc/gc.d @@ -651,7 +651,7 @@ void mark_range(void *pbot, void *ptop, size_t* pm_bitmask) // Adjust bit to be at start of allocated memory block if (bin <= B_PAGE) - bit_i = (offset & notbinsize[bin]) >> 4; + bit_i = (offset & notbinsize[bin]) / 16; else if (bin == B_PAGEPLUS) { do -- 2.43.0