[all-commits] [llvm/llvm-project] b4a77f: [libc][__support] Implement exact linear binning f...

Schrodinger ZHU Yifan via All-commits all-commits at lists.llvm.org
Thu Jul 30 14:53:07 PDT 2026


  Branch: refs/heads/users/schrodingerzhu/libc-use-tlsf-freestore
  Home:   https://github.com/llvm/llvm-project
  Commit: b4a77f5fc7c5123ee9966595dcffc48481e30592
      https://github.com/llvm/llvm-project/commit/b4a77f5fc7c5123ee9966595dcffc48481e30592
  Author: Yifan Zhu <yfzhu at google.com>
  Date:   2026-07-30 (Thu, 30 Jul 2026)

  Changed paths:
    M libc/src/__support/freestore.h
    M libc/test/src/__support/freestore_test.cpp

  Log Message:
  -----------
  [libc][__support] Implement exact linear binning for TLSFFreeStoreImpl

Previously, size_to_bit_index used size >> UNIT_SIZE_LOG2 for linear bins,
which mapped size 24 to bin 1 and size 17 to bin 1, causing a mismatch
between allocation request sizes and physical block bucket sizes.

This change introduces exact mapping for linear bins:
- Sizes <= MIN_INNER_SIZE map to bin 0.
- Larger linear sizes use ((size - MIN_INNER_SIZE - 1) >> UNIT_SIZE_LOG2) + 1.
- Exponential bins remain unchanged (verified by z3).

TAG=agy
CONV=811f354e-5729-4a5f-af17-de4b5ca9e647



To unsubscribe from these emails, change your notification settings at https://github.com/llvm/llvm-project/settings/notifications


More information about the All-commits mailing list