From: Maoni Stephens Date: Mon, 4 May 2020 23:05:20 +0000 (-0700) Subject: fix a regression introduced by Refactor handling of non-SOH generations (#1688) X-Git-Tag: submit/tizen/20210909.063632~8199 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=2b3de4f14f879ed7005e5c748d5f3e2a6d553b6e;p=platform%2Fupstream%2Fdotnet%2Fruntime.git fix a regression introduced by Refactor handling of non-SOH generations (#1688) this is supposed to get the user allocations, before #1688 it was getting gen0 and gen3. with the refactor it should get gen0 and all UOH allocations. --- diff --git a/src/coreclr/src/gc/gc.cpp b/src/coreclr/src/gc/gc.cpp index 6c5c1d7..a91de0d 100644 --- a/src/coreclr/src/gc/gc.cpp +++ b/src/coreclr/src/gc/gc.cpp @@ -15020,11 +15020,12 @@ size_t gc_heap::get_total_allocated_since_last_gc() // Gets what's allocated on both SOH, LOH, etc that hasn't been collected. size_t gc_heap::get_current_allocated() { - size_t current_alloc = 0; - for (int i = max_generation; i < total_generation_count; i++) + dynamic_data* dd = dynamic_data_of (0); + size_t current_alloc = dd_desired_allocation (dd) - dd_new_allocation (dd); + for (int i = uoh_start_generation; i < total_generation_count; i++) { dynamic_data* dd = dynamic_data_of (i); - current_alloc = dd_desired_allocation (dd) - dd_new_allocation (dd); + current_alloc += dd_desired_allocation (dd) - dd_new_allocation (dd); } return current_alloc; }