Make GC.GetGCMemoryInfo public (#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)
commita8d440c432bacf81b770f65042ed1721f38be5e5
tree92bca2b2a96b8b7fad19ee39b78c6d181f6776b7
parent34aa89ecdeedac69bb2da3e63b23a1b97bb4cd23
Make GC.GetGCMemoryInfo public (#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
src/System.Private.CoreLib/shared/System/Buffers/TlsOverPerCoreLockedStacksArrayPool.cs
src/System.Private.CoreLib/src/System/GC.cs