]> gitweb.factorcode.org Git - factor.git/blobdiff - vm/mark_bits.hpp
xmode.marker: more correct faster update-match-group
[factor.git] / vm / mark_bits.hpp
index 410af37a4e50329755e79865e09bcb9777436ad7..efd66b339c34f0fc5811cc233f015ffdcb7f25fc 100644 (file)
@@ -51,13 +51,9 @@ struct mark_bits {
     return (bits[position.first] & ((cell)1 << position.second)) != 0;
   }
 
-  cell next_block_after(const cell block, const cell size) {
-    return block + size;
-  }
-
   void set_bitmap_range(cell* bits, const cell address, const cell size) {
     std::pair<cell, cell> start = bitmap_deref(address);
-    std::pair<cell, cell> end = bitmap_deref(next_block_after(address, size));
+    std::pair<cell, cell> end = bitmap_deref(address + size);
 
     cell start_mask = ((cell)1 << start.second) - 1;
     cell end_mask = ((cell)1 << end.second) - 1;
@@ -122,10 +118,9 @@ struct mark_bits {
         cell clear_bit = rightmost_clear_bit(mask);
         return line_block(index * mark_bits_granularity + bit_index +
                           clear_bit);
-      } else {
-        // No unmarked blocks on this page. Keep looking
-        bit_index = 0;
       }
+      // No unmarked blocks on this page. Keep looking
+      bit_index = 0;
     }
 
     // No unmarked blocks were found
@@ -142,10 +137,9 @@ struct mark_bits {
         // Found an marked block on this page. Stop, it's hammer time
         cell set_bit = rightmost_set_bit(mask);
         return line_block(index * mark_bits_granularity + bit_index + set_bit);
-      } else {
-        // No marked blocks on this page. Keep looking
-        bit_index = 0;
       }
+      // No marked blocks on this page. Keep looking
+      bit_index = 0;
     }
 
     // No marked blocks were found