[libc-commits] [libc] [libc] Use best-fit binary trie to make malloc logarithmic (PR #106259)
via libc-commits
libc-commits at lists.llvm.org
Thu Oct 10 10:41:14 PDT 2024
================
@@ -28,23 +28,16 @@ extern "C" cpp::byte __llvm_libc_heap_limit;
using cpp::optional;
using cpp::span;
-inline constexpr bool IsPow2(size_t x) { return x && (x & (x - 1)) == 0; }
+LIBC_INLINE constexpr bool IsPow2(size_t x) { return x && (x & (x - 1)) == 0; }
-static constexpr cpp::array<size_t, 6> DEFAULT_BUCKETS{16, 32, 64,
- 128, 256, 512};
-
-template <size_t NUM_BUCKETS = DEFAULT_BUCKETS.size()> class FreeListHeap {
+class FreeListHeap {
public:
using BlockType = Block<>;
----------------
nopsledder wrote:
It looks like this may not be needed, except for tests. If those just use `Block<>`, it can probably be removed.
https://github.com/llvm/llvm-project/pull/106259
More information about the libc-commits
mailing list