Skip to content

Commit fe13646

Browse files
authored
drop own BitScanForward64
1 parent 7f67e16 commit fe13646

File tree

1 file changed

+1
-11
lines changed

1 file changed

+1
-11
lines changed

src/cpucounters.cpp

Lines changed: 1 addition & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -7425,19 +7425,9 @@ int32 PCM::mapNUMANodeToSocket(uint32 numa_node_id) const
74257425

74267426
if (mask != 0)
74277427
{
7428-
auto BitScanForward64 = [](unsigned long* Index, uint64_t Mask)
7429-
{
7430-
if (Mask == 0) return 0;
7431-
7432-
// Magic numbers for LSB (chess engine style)
7433-
static const uint64_t magic = 0x03f79d71b4cb0a89ULL;
7434-
uint64_t isolated = Mask & -Mask; // Rightmost set bit
7435-
*Index = (unsigned long)(((isolated * magic) >> 58));
7436-
};
7437-
74387428
// Find first set bit (first processor in this NUMA node within this group)
74397429
DWORD bitPosition = 0;
7440-
BitScanForward64(&bitPosition, mask);
7430+
_BitScanForward64(&bitPosition, mask);
74417431

74427432
// On Windows, we need to find the logical processor ID that corresponds to
74437433
// this bit position in this group. We iterate through topology to find a match.

0 commit comments

Comments
 (0)