Skip to content

Commit 334d57e

Browse files
authored
Make sure get_total_soh_stable_size never return zero (#106043)
1 parent af1b3b0 commit 334d57e

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

src/coreclr/gc/gc.cpp

+6
Original file line numberDiff line numberDiff line change
@@ -22912,6 +22912,12 @@ size_t gc_heap::get_total_soh_stable_size()
2291222912
total_stable_size += hp->generation_size (max_generation - 1) / 2;
2291322913
}
2291422914

22915+
if (!total_stable_size)
22916+
{
22917+
// Setting a temp value before a GC naturally happens (ie, due to allocation).
22918+
total_stable_size = dd_min_size (g_heaps[0]->dynamic_data_of (max_generation - 1));
22919+
}
22920+
2291522921
return total_stable_size;
2291622922
}
2291722923
}

0 commit comments

Comments
 (0)