Skip to content

Commit

Permalink
Make sure get_total_soh_stable_size never return zero (dotnet#106043)
Browse files Browse the repository at this point in the history
  • Loading branch information
cshung authored Aug 7, 2024
1 parent af1b3b0 commit 334d57e
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/coreclr/gc/gc.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -22912,6 +22912,12 @@ size_t gc_heap::get_total_soh_stable_size()
total_stable_size += hp->generation_size (max_generation - 1) / 2;
}

if (!total_stable_size)
{
// Setting a temp value before a GC naturally happens (ie, due to allocation).
total_stable_size = dd_min_size (g_heaps[0]->dynamic_data_of (max_generation - 1));
}

return total_stable_size;
}
}
Expand Down

0 comments on commit 334d57e

Please sign in to comment.