[Mono] [GC] Fix TotalBytesAllocated and reenable test (#20427)
commite02944035d6508187e03358b8c35558c93de4dd0
authormonojenkins <jo.shields+jenkins@xamarin.com>
Thu, 24 Sep 2020 17:39:36 +0000 (24 13:39 -0400)
committerGitHub <noreply@github.com>
Thu, 24 Sep 2020 17:39:36 +0000 (24 13:39 -0400)
treec572712775e0c907c6dbdb7239d75b5a0ec2e8c9
parent53b75b3f21c2615454571915fcbff92c136e07cf
[Mono] [GC] Fix TotalBytesAllocated and reenable test (#20427)

TotalBytesAllocated was sometimes not monotonically increasing on Mono. The reason was that when a thread was detached, we were not counting bytes allocated in its thread local allocation buffer. So, under the right circumstances the bytes would be counted while the thread is attached, but then get lost when the thread detached.

Fixes: https://github.com/dotnet/runtime/issues/2280

Co-authored-by: naricc <naricc@users.noreply.github.com>
mono/metadata/sgen-mono.c