diff options
author | Jan Vorlicek <janvorli@microsoft.com> | 2019-04-17 10:59:41 -0700 |
---|---|---|
committer | Jan Vorlicek <janvorli@microsoft.com> | 2019-04-17 10:59:41 -0700 |
commit | 0d9114b1f5d0b125f04f1ec17064a761fb26ba66 (patch) | |
tree | 819db8a187f08973770d91d3f6c30c1e0317bb37 /src/vm | |
parent | df2f4c4feb273545e91fd8d7d170dc424b741f19 (diff) | |
download | coreclr-0d9114b1f5d0b125f04f1ec17064a761fb26ba66.tar.gz coreclr-0d9114b1f5d0b125f04f1ec17064a761fb26ba66.tar.bz2 coreclr-0d9114b1f5d0b125f04f1ec17064a761fb26ba66.zip |
Put back the CPU limiting in GC
The CPU limiting was accidentally removed during refactoring of the CPU
groups support in GC. This change puts them back.
Diffstat (limited to 'src/vm')
-rw-r--r-- | src/vm/gcenv.os.cpp | 12 |
1 files changed, 4 insertions, 8 deletions
diff --git a/src/vm/gcenv.os.cpp b/src/vm/gcenv.os.cpp index e20c36e48f..6e3f775660 100644 --- a/src/vm/gcenv.os.cpp +++ b/src/vm/gcenv.os.cpp @@ -32,10 +32,6 @@ uint32_t g_pageSizeUnixInl = 0; static AffinitySet g_processAffinitySet; -#ifdef FEATURE_PAL -static uint32_t g_currentProcessCpuCount; -#endif // FEATURE_PAL - class GroupProcNo { uint16_t m_groupProc; @@ -111,15 +107,15 @@ bool GCToOSInterface::Initialize() #ifdef FEATURE_PAL g_pageSizeUnixInl = GetOsPageSize(); - g_currentProcessCpuCount = PAL_GetLogicalCpuCountFromOS(); + uint32_t currentProcessCpuCount = PAL_GetLogicalCpuCountFromOS(); if (PAL_GetCurrentThreadAffinitySet(AffinitySet::BitsetDataSize, g_processAffinitySet.GetBitsetData())) { - assert(g_currentProcessCpuCount == g_processAffinitySet.Count()); + assert(currentProcessCpuCount == g_processAffinitySet.Count()); } else { // There is no way to get affinity on the current OS, set the affinity set to reflect all processors - for (size_t i = 0; i < g_currentProcessCpuCount; i++) + for (size_t i = 0; i < currentProcessCpuCount; i++) { g_processAffinitySet.Add(i); } @@ -582,7 +578,7 @@ uint32_t GCToOSInterface::GetCurrentProcessCpuCount() GCToOSInterface::GetTotalProcessorCount(): ::GetCurrentProcessCpuCount(); #else // !FEATURE_PAL - return g_currentProcessCpuCount; + return ::GetCurrentProcessCpuCount(); #endif // !FEATURE_PAL } |