Browse Source

Fix for detection of number of CPU cores on Windows

tags/2021-05-28
jules 8 years ago
parent
commit
0c24b48be8
1 changed files with 2 additions and 2 deletions
  1. +2
    -2
      modules/juce_core/native/juce_win32_SystemStats.cpp

+ 2
- 2
modules/juce_core/native/juce_win32_SystemStats.cpp View File

@@ -99,10 +99,10 @@ static int findNumberOfPhysicalCores() noexcept
{
int numPhysicalCores = 0;
DWORD bufferSize = 0;
GetLogicalProcessorInformation (nullptr, &bufferSize);
if (GetLogicalProcessorInformation (nullptr, &bufferSize))
if (auto numBuffers = (size_t) (bufferSize / sizeof (SYSTEM_LOGICAL_PROCESSOR_INFORMATION)))
{
const size_t numBuffers = (size_t) (bufferSize / sizeof (SYSTEM_LOGICAL_PROCESSOR_INFORMATION));
HeapBlock<SYSTEM_LOGICAL_PROCESSOR_INFORMATION> buffer (numBuffers);
if (GetLogicalProcessorInformation (buffer, &bufferSize))


Loading…
Cancel
Save