MCPcopy Create free account
hub / github.com/cuberite/cuberite / GetNumCores

Function GetNumCores

Tools/BiomeVisualiser/BiomeCache.cpp:14–29  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

12
13
14static int GetNumCores(void)
15{
16 // Get number of cores by querying the system process affinity mask
17 DWORD Affinity, ProcAffinity;
18 GetProcessAffinityMask(GetCurrentProcess(), &ProcAffinity, &Affinity);
19 int NumCores = 0;
20 while (Affinity > 0)
21 {
22 if ((Affinity & 1) == 1)
23 {
24 NumCores++;
25 }
26 Affinity >>= 1;
27 } // while (Affinity > 0)
28 return NumCores;
29}
30
31
32

Callers 1

cBiomeCacheMethod · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected