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