[GC] Fix the bounds of desired size equalization loop . (#35226)
authorVladimir Sadov <vsadov@microsoft.com>
Tue, 21 Apr 2020 17:13:52 +0000 (10:13 -0700)
committerGitHub <noreply@github.com>
Tue, 21 Apr 2020 17:13:52 +0000 (17:13 +0000)
* Fix the bounds of desired size equalization loop .

* Use <= in the right place.

src/coreclr/src/gc/gc.cpp

index 3e3096e604eae5b9813a0916695b9af3a3f0a6e2..f7c11b7da9fc73e373bf5817c479d1f8433ff40a 100644 (file)
@@ -16291,9 +16291,9 @@ void gc_heap::gc1()
             int limit = settings.condemned_generation;
             if (limit == max_generation)
             {
-                limit = total_generation_count;
+                limit = total_generation_count-1;
             }
-            for (int gen = 0; gen < limit; gen++)
+            for (int gen = 0; gen <= limit; gen++)
             {
                 size_t total_desired = 0;