MCPcopy Create free account
hub / github.com/cameron314/concurrentqueue / countBitsSet

Function countBitsSet

benchmarks/cpuid.cpp:16–24  ·  view source on GitHub ↗

Helper function to count set bits in the processor mask.

Source from the content-addressed store, hash-verified

14
15// Helper function to count set bits in the processor mask.
16int countBitsSet(ULONG_PTR bitMask)
17{
18 int result = 0;
19 while (bitMask != 0) {
20 result += (int)(bitMask & 1);
21 bitMask >>= 1;
22 }
23 return result;
24}
25
26bool getProcessorInfoFromOS(int& cpus, int& cores, int& logicalCores, double& clockSpeed)
27{

Callers 1

getProcessorInfoFromOSFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected