From 4e2a9e50f6dd6760b12838517c7f85a0c9032921 Mon Sep 17 00:00:00 2001 From: Petr Hosek Date: Thu, 12 Dec 2024 11:24:36 -0800 Subject: [libc] Breakup freelist_malloc into separate files (#98784) This better matches the structure we use for the rest of libc. --- libc/src/stdlib/baremetal/aligned_alloc.cpp | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100644 libc/src/stdlib/baremetal/aligned_alloc.cpp (limited to 'libc/src/stdlib/baremetal/aligned_alloc.cpp') diff --git a/libc/src/stdlib/baremetal/aligned_alloc.cpp b/libc/src/stdlib/baremetal/aligned_alloc.cpp new file mode 100644 index 000000000000..e9548719c3a6 --- /dev/null +++ b/libc/src/stdlib/baremetal/aligned_alloc.cpp @@ -0,0 +1,21 @@ +//===-- Implementation for freelist_malloc --------------------------------===// +// +// 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/stdlib/aligned_alloc.h" +#include "src/__support/freelist_heap.h" +#include "src/__support/macros/config.h" + +#include + +namespace LIBC_NAMESPACE_DECL { + +LLVM_LIBC_FUNCTION(void *, aligned_alloc, (size_t alignment, size_t size)) { + return freelist_heap->aligned_allocate(alignment, size); +} + +} // namespace LIBC_NAMESPACE_DECL -- cgit v1.2.3 From 379cc44f56e6f220422ce85d2295833f849086e0 Mon Sep 17 00:00:00 2001 From: Petr Hosek Date: Thu, 12 Dec 2024 13:28:30 -0800 Subject: Revert "[libc] Breakup freelist_malloc into separate files" (#119749) Reverts llvm/llvm-project#98784 which broke libc builders. --- libc/src/stdlib/baremetal/aligned_alloc.cpp | 21 --------------------- 1 file changed, 21 deletions(-) delete mode 100644 libc/src/stdlib/baremetal/aligned_alloc.cpp (limited to 'libc/src/stdlib/baremetal/aligned_alloc.cpp') diff --git a/libc/src/stdlib/baremetal/aligned_alloc.cpp b/libc/src/stdlib/baremetal/aligned_alloc.cpp deleted file mode 100644 index e9548719c3a6..000000000000 --- a/libc/src/stdlib/baremetal/aligned_alloc.cpp +++ /dev/null @@ -1,21 +0,0 @@ -//===-- Implementation for freelist_malloc --------------------------------===// -// -// 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/stdlib/aligned_alloc.h" -#include "src/__support/freelist_heap.h" -#include "src/__support/macros/config.h" - -#include - -namespace LIBC_NAMESPACE_DECL { - -LLVM_LIBC_FUNCTION(void *, aligned_alloc, (size_t alignment, size_t size)) { - return freelist_heap->aligned_allocate(alignment, size); -} - -} // namespace LIBC_NAMESPACE_DECL -- cgit v1.2.3 From 7bf3137c39a61283ebcb58793e830f8b768b74e7 Mon Sep 17 00:00:00 2001 From: Petr Hosek Date: Mon, 16 Dec 2024 10:30:27 -0800 Subject: [libc] Breakup freelist_malloc into separate files (#119806) This better matches the structure we use for the rest of libc. --- libc/src/stdlib/baremetal/aligned_alloc.cpp | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100644 libc/src/stdlib/baremetal/aligned_alloc.cpp (limited to 'libc/src/stdlib/baremetal/aligned_alloc.cpp') diff --git a/libc/src/stdlib/baremetal/aligned_alloc.cpp b/libc/src/stdlib/baremetal/aligned_alloc.cpp new file mode 100644 index 000000000000..e9548719c3a6 --- /dev/null +++ b/libc/src/stdlib/baremetal/aligned_alloc.cpp @@ -0,0 +1,21 @@ +//===-- Implementation for freelist_malloc --------------------------------===// +// +// 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/stdlib/aligned_alloc.h" +#include "src/__support/freelist_heap.h" +#include "src/__support/macros/config.h" + +#include + +namespace LIBC_NAMESPACE_DECL { + +LLVM_LIBC_FUNCTION(void *, aligned_alloc, (size_t alignment, size_t size)) { + return freelist_heap->aligned_allocate(alignment, size); +} + +} // namespace LIBC_NAMESPACE_DECL -- cgit v1.2.3