In gc_heap::walk_heap_per_heap, we need to iterate through the SOH generations if...
authorPeter Sollich <petersol@microsoft.com>
Fri, 11 Jun 2021 07:58:10 +0000 (09:58 +0200)
committerGitHub <noreply@github.com>
Fri, 11 Jun 2021 07:58:10 +0000 (09:58 +0200)
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

index 64ec770..909e558 100644 (file)
@@ -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)