Skip to content
Open
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
20 changes: 20 additions & 0 deletions src/coreclr/gc/gc.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -12638,6 +12638,11 @@ size_t gc_heap::decommit_heap_segment_pages_worker (heap_segment* seg,
void gc_heap::decommit_heap_segment (heap_segment* seg)
{
#ifdef USE_REGIONS
if (use_large_pages_p)
{
return;
}

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This block is not in the net11 fix. Is it a part of something else?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It was actually part of another change that preceded that net11 fix (#127290) . Cherry picking that bit of the change was necessary to cover all cases in .NET 10. This early out is safe, since there already is another early out for regions (when memory pressure is not high).

if (!dt_high_memory_load_p())
{
return;
Expand Down Expand Up @@ -38001,6 +38006,21 @@ void gc_heap::compact_phase (int condemned_gen_number,

recover_saved_pinned_info();

#ifdef USE_REGIONS
for (int i = 0; i <= min (condemned_gen_number + 1, (int)max_generation); i++)
{
generation* gen = generation_of (i);
for (heap_segment* region = generation_start_segment_rw (gen);
region != nullptr;
region = heap_segment_next_rw (region))
{
uint8_t* plan_allocated = heap_segment_plan_allocated (region);
if (plan_allocated > heap_segment_used (region))
heap_segment_used (region) = plan_allocated;
}
}
#endif //USE_REGIONS

concurrent_print_time_delta ("compact end");

dprintf (2, (ThreadStressLog::gcEndCompactMsg(), heap_number));
Expand Down
Loading