mirror of
https://github.com/juce-framework/JUCE.git
synced 2026-02-07 04:10:08 +00:00
Fix for detection of number of CPU cores on Windows
This commit is contained in:
parent
a1794b1143
commit
0c24b48be8
1 changed files with 2 additions and 2 deletions
|
|
@ -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…
Add table
Add a link
Reference in a new issue