Skip to content

Commit 67a0113

Browse files
authored
[libc] Replace __builtin_popcountl with cpp::popcount in sched_getcpucount (#131952)
Closes #128781.
1 parent 2d09028 commit 67a0113

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

libc/src/sched/linux/sched_getcpucount.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88

99
#include "src/sched/sched_getcpucount.h"
1010

11+
#include "src/__support/CPP/bit.h"
1112
#include "src/__support/common.h"
1213
#include "src/__support/macros/config.h"
1314

@@ -20,7 +21,7 @@ LLVM_LIBC_FUNCTION(int, __sched_getcpucount,
2021
(size_t cpuset_size, const cpu_set_t *mask)) {
2122
int result = 0;
2223
for (size_t i = 0; i < cpuset_size / sizeof(long); ++i) {
23-
result += __builtin_popcountl(mask->__mask[i]);
24+
result += cpp::popcount(mask->__mask[i]);
2425
}
2526
return result;
2627
}

0 commit comments

Comments
 (0)