Implement GC.RegisterMemoryLoadChangeNotification (dotnet/coreclr#24202)
authorLudovic Henry <luhenry@microsoft.com>
Thu, 2 May 2019 14:39:19 +0000 (07:39 -0700)
committerGitHub <noreply@github.com>
Thu, 2 May 2019 14:39:19 +0000 (07:39 -0700)
commit346c5edc3073b2e0a11a9ab4720766731fd0ef0f
treeb0d4eaf01ef0a282563bdab1d871f129fcc75c9b
parent4eb6559f8633166cba533dcd0dfdb0350a3a4223
Implement GC.RegisterMemoryLoadChangeNotification (dotnet/coreclr#24202)

* Implement GC.RegisterMemoryLoadChangeNotification

This allows users to register a callback to be called whenever the
memory load is between a low and high thresholds. The idea is to allow
them to tweak their memory usage based on the available memory.

It is only internal for now because we are not confident on the shape of
the API and if it's the best we can provide users. This needs to go
through a few iterations with first party users like ASP.NET or corefx.

WIP for https://github.com/dotnet/coreclr/issues/18619

* fixup! Implement GC.RegisterMemoryLoadChangeNotification

* fixup! Implement GC.RegisterMemoryLoadChangeNotification

* fixup! Implement GC.RegisterMemoryLoadChangeNotification

Commit migrated from https://github.com/dotnet/coreclr/commit/cc83b8f9b1961619c89d7c2413ae171e49df5e59
src/coreclr/src/System.Private.CoreLib/src/System/GC.cs
src/libraries/System.Private.CoreLib/src/System/Gen2GcCallback.cs