MCPcopy Create free account
hub / github.com/Niko1221/Strata / mask_popcount

Function mask_popcount

engine/src/kernels/cpu/pool_affinity_linux_test.cpp:253–258  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

251}
252
253static size_t mask_popcount(const std::vector<unsigned long>& words) {
254 size_t bits = 0;
255 for (unsigned long w : words)
256 for (unsigned long x = w; x != 0; x &= x - 1) ++bits;
257 return bits;
258}
259
260// PR#14: the mask read once had an unbraced `else` that bound to the INNER `if (CPU_ISSET(...))`, so every CPU id
261// outside the mask re-appended all hardware_concurrency() ids: a k-of-CPU_SETSIZE mask returned

Callers 1

dangling_else_guardFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected