Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 9 additions & 1 deletion src/coreclr/gc/gc.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -25490,8 +25490,9 @@ bool gc_heap::change_heap_count (int new_n_heaps)
from_heap_number = (from_heap_number + 1) % old_n_heaps;
}

// prepare for the switch by fixing the allocation contexts on the old heaps,
// prepare for the switch by fixing the allocation contexts on the old heaps, unify the gen0_bricks_cleared flag,
// and setting the survived size for the existing regions to their allocated size
BOOL unified_gen0_bricks_cleared = TRUE;
for (int i = 0; i < old_n_heaps; i++)
{
gc_heap* hp = g_heaps[i];
Expand All @@ -25501,6 +25502,11 @@ bool gc_heap::change_heap_count (int new_n_heaps)
hp->fix_allocation_contexts (TRUE);
}

if (unified_gen0_bricks_cleared && (hp->gen0_bricks_cleared == FALSE))
{
unified_gen0_bricks_cleared = FALSE;
}

for (int gen_idx = 0; gen_idx < total_generation_count; gen_idx++)
{
generation* gen = hp->generation_of (gen_idx);
Expand Down Expand Up @@ -25611,6 +25617,8 @@ bool gc_heap::change_heap_count (int new_n_heaps)
{
gc_heap* hp = g_heaps[i];

hp->gen0_bricks_cleared = unified_gen0_bricks_cleared;

// establish invariants regarding the ephemeral segment
generation* gen0 = hp->generation_of (0);
if ((hp->ephemeral_heap_segment == nullptr) ||
Expand Down