Make GC.GetGCMemoryInfo public (dotnet/coreclr#23779)
authorLudovic Henry <luhenry@microsoft.com>
Wed, 10 Apr 2019 22:57:00 +0000 (15:57 -0700)
committerGitHub <noreply@github.com>
Wed, 10 Apr 2019 22:57:00 +0000 (15:57 -0700)
commit98280c683b76483a7fdec91a00978f4bdc538df6
tree16feb879a24aca887f3093f8d5f612f4b2158637
parentf46d159979f8bd36f6bb9364d88dee3381dc8660
Make GC.GetGCMemoryInfo public (dotnet/coreclr#23779)

* Make GC.GetGCMemoryInfo public

This is to be used to allow users to optimize memory consumption based
on what's available to the GC and on the system.

This is based on https://github.com/dotnet/corefx/issues/34631

* Address reviews

- Pass GCMemoryInfo struct to native in place of many arguments
- Make GCMemoryInfo.HeapSize and GCMemoryInfo.Fragmentation long in place of IntPtr

* Address reviews

- Mark GCMemoryInfo readonly

* Rearrange fields and match managed/native names

* Fix compilation

* Use getter shorthand

* Address API Design Review

https://github.com/dotnet/corefx/issues/34631#issuecomment-481358549

* Fix comments

* Fix comments

* Do everything in managed

* Address review

 - Remove unecessary [StructLayout.Sequential]
 - Remove "_" prefix for parameters variables

Commit migrated from https://github.com/dotnet/coreclr/commit/a8d440c432bacf81b770f65042ed1721f38be5e5
src/coreclr/src/System.Private.CoreLib/src/System/GC.cs
src/libraries/System.Private.CoreLib/src/System/Buffers/TlsOverPerCoreLockedStacksArrayPool.cs