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

Pavel Labath via libc-commits libc-commits at lists.llvm.org
Thu Jun 11 05:56:14 PDT 2026


================
@@ -0,0 +1,22 @@
+//===-- Implementation of sched_cpufree -----------------------------------===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+//
+//===----------------------------------------------------------------------===//
+
+#include "src/sched/sched_cpufree.h"
+#include "hdr/stdint_proxy.h"
+#include "hdr/types/cpu_set_t.h"
+#include "src/__support/CPP/new.h"
+#include "src/__support/common.h"
+#include "src/__support/macros/config.h"
+
+namespace LIBC_NAMESPACE_DECL {
+
+LLVM_LIBC_FUNCTION(void, __sched_cpufree, (cpu_set_t * set)) {
+  delete[] reinterpret_cast<uint8_t *>(set);
----------------
labath wrote:

I don't think it's necessary because we're not avoiding UB, but I can be convinced otherwise...

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


More information about the libc-commits mailing list