[libc-commits] [libc] [libc] Lazily initialize freelist malloc using symbols (PR #99254)

via libc-commits libc-commits at lists.llvm.org
Tue Jul 16 16:14:28 PDT 2024


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 5b82741a011c1b080ab03dbf70b808bab3813ea9 802dfdbef69e2b79dff682eea195ba4468f68ed6 --extensions h,cpp -- libc/src/__support/freelist_heap.h libc/src/stdlib/freelist_malloc.cpp libc/test/src/__support/freelist_heap_test.cpp libc/test/src/__support/freelist_malloc_test.cpp
``````````

</details>

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

``````````diff
diff --git a/libc/src/__support/freelist_heap.h b/libc/src/__support/freelist_heap.h
index d7fcbdc2aa..31fca66b89 100644
--- a/libc/src/__support/freelist_heap.h
+++ b/libc/src/__support/freelist_heap.h
@@ -107,11 +107,11 @@ class FreeListHeapSymbols : public FreeListHeap<NUM_BUCKETS> {
 
 public:
   constexpr FreeListHeapSymbols()
-      : FreeListHeap<NUM_BUCKETS>{{(cpp::byte*)&_end, (size_t)&__libc_heap_limit}} {}
+      : FreeListHeap<NUM_BUCKETS>{
+            {(cpp::byte *)&_end, (size_t)&__libc_heap_limit}} {}
 };
 
-template <size_t NUM_BUCKETS>
-void FreeListHeap<NUM_BUCKETS>::init() {
+template <size_t NUM_BUCKETS> void FreeListHeap<NUM_BUCKETS>::init() {
   LIBC_ASSERT(!is_initialized_ && "duplicate initialization");
   auto result = BlockType::init(region_);
   BlockType *block = *result;

``````````

</details>


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


More information about the libc-commits mailing list