From f2b5f1c37bc5242e2786cca3cb622b9b9b71fc09 Mon Sep 17 00:00:00 2001 From: Peter Sollich Date: Fri, 11 Jun 2021 09:58:10 +0200 Subject: [PATCH] In gc_heap::walk_heap_per_heap, we need to iterate through the SOH generations if USE_REGIONS is enabled. (#53995) In gc_heap::walk_heap_per_heap, we need to iterate through the SOH generations if USE_REGIONS is enabled - otherwise the lower SOH generations may be skipped. --- src/coreclr/gc/gc.cpp | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/src/coreclr/gc/gc.cpp b/src/coreclr/gc/gc.cpp index 64ec770..909e558 100644 --- a/src/coreclr/gc/gc.cpp +++ b/src/coreclr/gc/gc.cpp @@ -44530,6 +44530,19 @@ void gc_heap::walk_heap_per_heap (walk_fn fn, void* context, int gen_number, BOO end = heap_segment_allocated (seg); continue; } +#ifdef USE_REGIONS + else if (gen_number > 0) + { + // advance to next lower generation + gen_number--; + gen = gc_heap::generation_of (gen_number); + seg = generation_start_segment (gen); + + x = heap_segment_mem (seg); + end = heap_segment_allocated (seg); + continue; + } +#endif // USE_REGIONS else { if (walk_large_object_heap_p) -- 2.7.4