void gc_heap::mark_object (uint8_t* o THREAD_NUMBER_DCL)
{
#ifdef USE_REGIONS
- if (is_in_condemned_gc (o))
+ if ((o != nullptr) && is_in_condemned_gc (o))
{
mark_object_simple (&o THREAD_NUMBER_ARG);
}
#endif //MULTIPLE_HEAPS
BOOL full_p = (condemned_gen_number == max_generation);
- dprintf(3,("Processing Mark overflow [%Ix %Ix]", (size_t)min_add, (size_t)max_add));
+ dprintf(3,("Processing Mark overflow [%Ix %Ix]", (size_t)min_add, (size_t)max_add));
+
+ size_t obj_count = 0;
+
#ifdef MULTIPLE_HEAPS
for (int hi = 0; hi < n_heaps; hi++)
{
#else
{
gc_heap* hp = 0;
-
#endif //MULTIPLE_HEAPS
int gen_limit = full_p ? total_generation_count : condemned_gen_number + 1;
- for (int i = condemned_gen_number; i < gen_limit; i++)
+ for (int i = get_stop_generation_index (condemned_gen_number); i < gen_limit; i++)
{
generation* gen = hp->generation_of (i);
heap_segment* seg = heap_segment_in_range (generation_start_segment (gen));
if (marked (o))
{
mark_through_object (o, TRUE THREAD_NUMBER_ARG);
+ obj_count++;
}
o = o + Align (size (o), align_const);
seg = heap_segment_next_in_range (seg);
}
}
+#ifndef MULTIPLE_HEAPS
+ // we should have found at least one object
+ assert (obj_count > 0);
+#endif //MULTIPLE_HEAPS
}
}