Skip to content

Commit

Permalink
Disable gen 1 budget accounting fix for segments, so the segments imp…
Browse files Browse the repository at this point in the history
…lementation of GC behaves like .NET 6.0 did. (dotnet#76365)
  • Loading branch information
PeterSolMS authored Sep 29, 2022
1 parent 8ff1bd0 commit 43fa22f
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions src/coreclr/gc/gc.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -21467,7 +21467,14 @@ void gc_heap::gc1()
dynamic_data* dd = hp->dynamic_data_of (gen);
dd_desired_allocation (dd) = desired_per_heap;
dd_gc_new_allocation (dd) = desired_per_heap;
#ifdef USE_REGIONS
// we may have had some incoming objects during this GC -
// adjust the consumed budget for these
dd_new_allocation (dd) = desired_per_heap - already_consumed_per_heap;
#else //USE_REGIONS
// for segments, we want to keep the .NET 6.0 behavior where we did not adjust
dd_new_allocation (dd) = desired_per_heap;
#endif //USE_REGIONS

if (gen == 0)
{
Expand Down Expand Up @@ -40506,9 +40513,14 @@ void gc_heap::compute_new_dynamic_data (int gen_number)
}
dd_gc_new_allocation (dd) = dd_desired_allocation (dd);

#ifdef USE_REGIONS
// we may have had some incoming objects during this GC -
// adjust the consumed budget for these
dd_new_allocation (dd) = dd_gc_new_allocation (dd) - in;
#else //USE_REGIONS
// for segments, we want to keep the .NET 6.0 behavior where we did not adjust
dd_new_allocation (dd) = dd_gc_new_allocation (dd);
#endif //USE_REGIONS
}

gen_data->pinned_surv = dd_pinned_survived_size (dd);
Expand Down

0 comments on commit 43fa22f

Please sign in to comment.