Fix mark overflow processing (#38969)
authorJan Vorlicek <janvorli@microsoft.com>
Fri, 10 Jul 2020 01:41:09 +0000 (03:41 +0200)
committerGitHub <noreply@github.com>
Fri, 10 Jul 2020 01:41:09 +0000 (18:41 -0700)
commita6f7b83c323adcde55663e2c7dedffc39514a527
treeee8d8471a39f2bb30d75cbe739e578f5a07f139d
parent42453bec7437018c6ad024391f717b5183db238f
Fix mark overflow processing (#38969)

A recent refactoring PR #1688 has regressed GC processing of mark overflow.
If GC heap segments in the segment linked list are not ordered in an ascending
order by their addresses, the mark overflow processing misses segments on
lower addresses if they follow segments on higher addresses.
This leads to some objects that are alive to not to be reported and freed.

This change fixes the problem by making sure the segment order doesn't matter.
src/coreclr/src/gc/gc.cpp