BOOL gc_heap::gen0_bricks_cleared = FALSE;
-#ifdef FFIND_OBJECT
int gc_heap::gen0_must_clear_bricks = 0;
-#endif //FFIND_OBJECT
#ifdef FEATURE_PREMORTEM_FINALIZATION
CFinalize* gc_heap::finalize_queue = 0;
}
//this portion can be done after we release the lock
- if (seg == ephemeral_heap_segment)
+ if (seg == ephemeral_heap_segment ||
+ ((seg == nullptr) && (gen_number == 0) && (limit_size >= CLR_SIZE / 2)))
{
-#ifdef FFIND_OBJECT
if (gen0_must_clear_bricks > 0)
{
//set the brick table to speed up find_object
*x = -1;
}
else
-#endif //FFIND_OBJECT
{
gen0_bricks_cleared = FALSE;
}
#ifdef FEATURE_LOH_COMPACTION
BOOL all_heaps_compacted_p = TRUE;
#endif //FEATURE_LOH_COMPACTION
+ int max_gen0_must_clear_bricks = 0;
for (int i = 0; i < gc_heap::n_heaps; i++)
{
gc_heap* hp = gc_heap::g_heaps[i];
#ifdef FEATURE_LOH_COMPACTION
all_heaps_compacted_p &= hp->loh_compacted_p;
#endif //FEATURE_LOH_COMPACTION
+ // compute max of gen0_must_clear_bricks over all heaps
+ max_gen0_must_clear_bricks = max(max_gen0_must_clear_bricks, hp->gen0_must_clear_bricks);
}
#ifdef FEATURE_LOH_COMPACTION
check_loh_compact_mode (all_heaps_compacted_p);
#endif //FEATURE_LOH_COMPACTION
+ // if max_gen0_must_clear_bricks > 0, distribute to all heaps -
+ // if one heap encountered an interior pointer during this GC,
+ // the next GC might see one on another heap
+ if (max_gen0_must_clear_bricks > 0)
+ {
+ for (int i = 0; i < gc_heap::n_heaps; i++)
+ {
+ gc_heap* hp = gc_heap::g_heaps[i];
+ hp->gen0_must_clear_bricks = max_gen0_must_clear_bricks;
+ }
+ }
+
fire_pevents();
pm_full_gc_init_or_clear();
set_brick (b, -1);
}
}
-#ifdef FFIND_OBJECT
//indicate that in the future this needs to be done during allocation
-#ifdef MULTIPLE_HEAPS
- gen0_must_clear_bricks = FFIND_DECAY*gc_heap::n_heaps;
-#else
gen0_must_clear_bricks = FFIND_DECAY;
-#endif //MULTIPLE_HEAPS
-#endif //FFIND_OBJECT
int brick_entry = get_brick_entry(brick_of (interior));
if (brick_entry == 0)
#endif //RESPECT_LARGE_ALIGNMENT || FEATURE_STRUCTALIGN
}
-#ifdef FFIND_OBJECT
if (gen0_must_clear_bricks > 0)
gen0_must_clear_bricks--;
-#endif //FFIND_OBJECT
size_t last_promoted_bytes = 0;
start = GetCycleCount32();
#endif //TIME_GC
-#ifdef FFIND_OBJECT
if (gen0_must_clear_bricks > 0)
gen0_must_clear_bricks--;
-#endif //FFIND_OBJECT
background_soh_alloc_count = 0;
background_loh_alloc_count = 0;