[libc-commits] [libc] [WIP][libc] Use best-fit binary trie to make malloc logarithmic (PR #106259)
via libc-commits
libc-commits at lists.llvm.org
Tue Aug 27 11:00:07 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 36f0d64818b39973ef74e1ce49e2f234340ccd1a cbab5b2ef793298663928a75b9c7dabb9c47e39a --extensions cpp,h -- libc/src/__support/freestore.h libc/src/__support/freetrie.h libc/test/src/__support/freestore_test.cpp libc/test/src/__support/freetrie_test.cpp libc/src/__support/block.h libc/src/__support/freelist.h 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 libc/test/src/__support/freelist_test.cpp
``````````
</details>
<details>
<summary>
View the diff from clang-format here.
</summary>
``````````diff
diff --git a/libc/src/__support/freestore.h b/libc/src/__support/freestore.h
index 309c629145..e5165edcac 100644
--- a/libc/src/__support/freestore.h
+++ b/libc/src/__support/freestore.h
@@ -61,8 +61,7 @@ inline void FreeStore::remove(Block<> *block) {
LIBC_ASSERT(block->inner_size_free() >= MIN_SIZE &&
"block too small to have been present");
if (is_small(block)) {
- FreeList *block_list =
- reinterpret_cast<FreeList *>(block->usable_space());
+ FreeList *block_list = reinterpret_cast<FreeList *>(block->usable_space());
FreeList *&list = small_list(block);
if (block_list == list)
FreeList::pop(list);
diff --git a/libc/test/src/__support/freestore_test.cpp b/libc/test/src/__support/freestore_test.cpp
index b593792d12..d62429c5ce 100644
--- a/libc/test/src/__support/freestore_test.cpp
+++ b/libc/test/src/__support/freestore_test.cpp
@@ -13,8 +13,6 @@
namespace LIBC_NAMESPACE_DECL {
-TEST(LlvmLibcFreeStore, PushPop) {
- EXPECT_EQ(1, 2);
-}
+TEST(LlvmLibcFreeStore, PushPop) { EXPECT_EQ(1, 2); }
} // namespace LIBC_NAMESPACE_DECL
``````````
</details>
https://github.com/llvm/llvm-project/pull/106259
More information about the libc-commits
mailing list