summaryrefslogtreecommitdiff
path: root/src/gc/sample
diff options
context:
space:
mode:
authorJan Kotas <jkotas@microsoft.com>2016-07-27 14:16:02 -0700
committerGitHub <noreply@github.com>2016-07-27 14:16:02 -0700
commit2d944f96aaf0a61a84cb7e6d19992657ef77e9ae (patch)
treee6d360187ddffd8ecfc819649de37c54d33887a8 /src/gc/sample
parent50d9704c7918ef6adbfe9b5f10619f0dddd58cc6 (diff)
downloadcoreclr-2d944f96aaf0a61a84cb7e6d19992657ef77e9ae.tar.gz
coreclr-2d944f96aaf0a61a84cb7e6d19992657ef77e9ae.tar.bz2
coreclr-2d944f96aaf0a61a84cb7e6d19992657ef77e9ae.zip
GC update from CoreRT (#6487)
https://github.com/dotnet/corert/tree/master/src/Native/gc 35d3eefeb4d14193433a103411526fa869321a82
Diffstat (limited to 'src/gc/sample')
-rw-r--r--src/gc/sample/gcenv.windows.cpp22
1 files changed, 9 insertions, 13 deletions
diff --git a/src/gc/sample/gcenv.windows.cpp b/src/gc/sample/gcenv.windows.cpp
index e35af6b6a0..76187f2185 100644
--- a/src/gc/sample/gcenv.windows.cpp
+++ b/src/gc/sample/gcenv.windows.cpp
@@ -13,8 +13,6 @@
#include "gcenv.h"
#include "gc.h"
-static LARGE_INTEGER performanceFrequency;
-
MethodTable * g_pFreeObjectMethodTable;
int32_t g_TrapReturningThreads;
@@ -23,12 +21,14 @@ bool g_fFinalizerRunOnShutDown;
GCSystemInfo g_SystemInfo;
+static LARGE_INTEGER g_performanceFrequency;
+
// Initialize the interface implementation
// Return:
// true if it has succeeded, false if it has failed
bool GCToOSInterface::Initialize()
{
- if (!::QueryPerformanceFrequency(&performanceFrequency))
+ if (!::QueryPerformanceFrequency(&g_performanceFrequency))
{
return false;
}
@@ -310,9 +310,12 @@ uint64_t GCToOSInterface::GetPhysicalMemoryLimit()
return memStatus.ullTotalPhys;
}
-// Get global memory status
+// Get memory status
// Parameters:
-// ms - pointer to the structure that will be filled in with the memory status
+// memory_load - A number between 0 and 100 that specifies the approximate percentage of physical memory
+// that is in use (0 indicates no memory use and 100 indicates full memory use).
+// available_physical - The amount of physical memory currently available, in bytes.
+// available_page_file - The maximum amount of memory the current process can commit, in bytes.
void GCToOSInterface::GetMemoryStatus(uint32_t* memory_load, uint64_t* available_physical, uint64_t* available_page_file)
{
MEMORYSTATUSEX memStatus;
@@ -356,14 +359,7 @@ int64_t GCToOSInterface::QueryPerformanceCounter()
// The counter frequency
int64_t GCToOSInterface::QueryPerformanceFrequency()
{
- LARGE_INTEGER frequency;
- if (!::QueryPerformanceFrequency(&frequency))
- {
- _ASSERTE(!"Fatal Error - cannot query performance counter.");
- abort();
- }
-
- return frequency.QuadPart;
+ return g_performanceFrequency.QuadPart;
}
// Get a time stamp with a low precision