Fixes when accessing fgn_maxgen_percent (dotnet/coreclr#25650)
authorAndy Hanson <anhans@microsoft.com>
Fri, 12 Jul 2019 23:20:52 +0000 (16:20 -0700)
committerGitHub <noreply@github.com>
Fri, 12 Jul 2019 23:20:52 +0000 (16:20 -0700)
commitaa54cd0a01a21d172e564d9e50b9e5cb0110e152
tree7297280aec3fe4a5c2d01c8fbe52d1216adeec12
parent427046fbda1f3aea1c971a280ce408b5aed34ada
Fixes when accessing fgn_maxgen_percent (dotnet/coreclr#25650)

* Fixes when accessing fgn_maxgen_percent

PR dotnet/coreclr#25350 changed `fgn_maxgen_percent` to be a per-heap property when
`MULTIPLE_HEAPS` is set. A few uses need to be updated.

* In `full_gc_wait`, must re-read `fgn_maxgen_percent` before the
  second test of `maxgen_percent == 0`.
  (Otherwise the second test is statically unreachable.)
* In RegisterForFullGCNotification, must set `fgn_maxgen_percent` when
  `MULTIPLE_HEAPS` is not set
* In CancelFullGCNotification, must set `fgn_maxgen_percent` for each
  heap separately when `MULTIPLE_HEAPS` is set.

Fix dotnet/corefxdotnet/coreclr#39374

* Avoid duplicate code when getting fgn_maxgen_percent twice in full_gc_wait

Commit migrated from https://github.com/dotnet/coreclr/commit/4b5ae70e341bad3c9f25d33cfee58d2bb93d3db7
src/coreclr/src/gc/gc.cpp