cell object_start_map::find_object_containing_card(cell card_index) {
if (card_index == 0)
return start;
- else {
- card_index--;
+ card_index--;
- while (object_start_offsets[card_index] == card_starts_inside_object) {
- /* First card should start with an object */
- FACTOR_ASSERT(card_index > 0);
- card_index--;
- }
- return start + card_index * card_size + object_start_offsets[card_index];
+ while (object_start_offsets[card_index] == card_starts_inside_object) {
+ // First card should start with an object
+ FACTOR_ASSERT(card_index > 0);
+ card_index--;
}
+ return start + card_index * card_size + object_start_offsets[card_index];
}
-/* we need to remember the first object allocated in the card */
+// we need to remember the first object allocated in the card
void object_start_map::record_object_start_offset(object* obj) {
cell idx = addr_to_card((cell)obj - start);
card obj_start = ((cell)obj & addr_card_mask);
mask >>= (offset / data_alignment);
if (mask == 0) {
- /* The rest of the block after the old object start is free */
+ // The rest of the block after the old object start is free
object_start_offsets[index] = card_starts_inside_object;
} else {
- /* Move the object start forward if necessary */
+ // Move the object start forward if necessary
object_start_offsets[index] =
(card)(offset + (rightmost_set_bit(mask) * data_alignment));
}