[libc-commits] [libc] [libc][malloc] Reuse the prev_ field for allocated blocks (PR #101265)

via libc-commits libc-commits at lists.llvm.org
Wed Jul 31 12:03:36 PDT 2024


================
@@ -332,29 +353,34 @@ Block<OffsetType, kAlign>::init(ByteSpan region) {
     return {};
 
   region = result.value();
-  if (region.size() < BLOCK_OVERHEAD)
+  if (region.size() < 2 * BLOCK_OVERHEAD)
----------------
PiJoules wrote:

Out of curiosity, why does this need to be `2 * BLOCK_OVERHEAD`?

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


More information about the libc-commits mailing list