Skip to content

Commit 36c213b

Browse files
TCMalloc Teamcopybara-github
authored andcommitted
CpuSet: Return void from CLR
CPU_CLR_S is documented to return void, but CpuSet::CLR was using it as a bool. This happened to compile with glibc, but is wrong in general. The return value of CLR is never used, so return void instead of bool. CpuSet is an internal class. https://man7.org/linux/man-pages/man3/CPU_SET.3.html PiperOrigin-RevId: 704991349 Change-Id: I67ab5469055a298111fd452ce63ca4c6f2682387
1 parent 6fba903 commit 36c213b

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

tcmalloc/internal/cpu_utils.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ class CpuSet {
3838
bool IsSet(int cpu) const {
3939
return CPU_ISSET_S(cpu, kCpuSetBytes, cpu_set_.data());
4040
}
41-
bool CLR(int cpu) { return CPU_CLR_S(cpu, kCpuSetBytes, cpu_set_.data()); }
41+
void CLR(int cpu) { CPU_CLR_S(cpu, kCpuSetBytes, cpu_set_.data()); }
4242
int Count() const { return CPU_COUNT_S(kCpuSetBytes, cpu_set_.data()); }
4343

4444
// Find the index of the first set CPU. Returns -1 if none are set.

0 commit comments

Comments
 (0)