[libc-commits] [libc] [libc] Implement CPU_ALLOC and CPU_FREE (PR #202349)

via libc-commits libc-commits at lists.llvm.org
Mon Jun 8 07:52:53 PDT 2026


github-actions[bot] wrote:

<!--LLVM CODE FORMAT COMMENT: {clang-format}-->


:warning: C/C++ code formatter, clang-format found issues in your code. :warning:

<details>
<summary>
You can test this locally with the following command:
</summary>

``````````bash
git-clang-format --diff origin/main HEAD --extensions cpp,h -- libc/src/sched/linux/sched_cpualloc.cpp libc/src/sched/linux/sched_cpufree.cpp libc/src/sched/sched_cpualloc.h libc/src/sched/sched_cpufree.h libc/test/src/sched/cpu_alloc_test.cpp libc/include/llvm-libc-macros/linux/sched-macros.h libc/include/llvm-libc-types/cpu_set_t.h --diff_from_common_commit
``````````

:warning:
The reproduction instructions above might return results for more than one PR
in a stack if you are using a stacked PR workflow. You can limit the results by
changing `origin/main` to the base branch/commit you want to compare against.
:warning:

</details>

<details>
<summary>
View the diff from clang-format here.
</summary>

``````````diff
diff --git a/libc/src/sched/linux/sched_cpufree.cpp b/libc/src/sched/linux/sched_cpufree.cpp
index a3d962966..74e9f7d36 100644
--- a/libc/src/sched/linux/sched_cpufree.cpp
+++ b/libc/src/sched/linux/sched_cpufree.cpp
@@ -15,7 +15,7 @@
 
 namespace LIBC_NAMESPACE_DECL {
 
-LLVM_LIBC_FUNCTION(void, __sched_cpufree, (cpu_set_t *set)) {
+LLVM_LIBC_FUNCTION(void, __sched_cpufree, (cpu_set_t * set)) {
   delete[] reinterpret_cast<uint8_t *>(set);
 }
 
diff --git a/libc/src/sched/sched_cpualloc.h b/libc/src/sched/sched_cpualloc.h
index de427b26b..1780e5f03 100644
--- a/libc/src/sched/sched_cpualloc.h
+++ b/libc/src/sched/sched_cpualloc.h
@@ -9,8 +9,8 @@
 #ifndef LLVM_LIBC_SRC_SCHED_SCHED_CPUALLOC_H
 #define LLVM_LIBC_SRC_SCHED_SCHED_CPUALLOC_H
 
-#include "src/__support/macros/config.h"
 #include "hdr/types/cpu_set_t.h"
+#include "src/__support/macros/config.h"
 
 namespace LIBC_NAMESPACE_DECL {
 
diff --git a/libc/src/sched/sched_cpufree.h b/libc/src/sched/sched_cpufree.h
index 44391e595..b8ee9e3ff 100644
--- a/libc/src/sched/sched_cpufree.h
+++ b/libc/src/sched/sched_cpufree.h
@@ -9,8 +9,8 @@
 #ifndef LLVM_LIBC_SRC_SCHED_SCHED_CPUFREE_H
 #define LLVM_LIBC_SRC_SCHED_SCHED_CPUFREE_H
 
-#include "src/__support/macros/config.h"
 #include "hdr/types/cpu_set_t.h"
+#include "src/__support/macros/config.h"
 
 namespace LIBC_NAMESPACE_DECL {
 
diff --git a/libc/test/src/sched/cpu_alloc_test.cpp b/libc/test/src/sched/cpu_alloc_test.cpp
index 898da3c2a..3749d6a3d 100644
--- a/libc/test/src/sched/cpu_alloc_test.cpp
+++ b/libc/test/src/sched/cpu_alloc_test.cpp
@@ -6,6 +6,8 @@
 //
 //===----------------------------------------------------------------------===//
 
+#include "hdr/sched_macros.h"
+#include "hdr/types/cpu_set_t.h"
 #include "src/sched/sched_cpualloc.h"
 #include "src/sched/sched_cpufree.h"
 #include "src/sched/sched_getcpucount.h"
@@ -13,8 +15,6 @@
 #include "src/sched/sched_setcpuset.h"
 #include "src/sched/sched_setcpuzero.h"
 #include "test/UnitTest/Test.h"
-#include "hdr/sched_macros.h"
-#include "hdr/types/cpu_set_t.h"
 
 namespace LIBC_NAMESPACE_DECL {
 

``````````

</details>


https://github.com/llvm/llvm-project/pull/202349


More information about the libc-commits mailing list