[libcxx-commits] [libcxx] Improve string allocation (PR #92652)

Valery Mironov via libcxx-commits libcxx-commits at lists.llvm.org
Tue Feb 17 18:58:55 PST 2026


MBkkt wrote:

@philnik777 Hi, after you made this commit https://github.com/llvm/llvm-project/commit/e95c5c85113066fbf14307e31a533fdb1a7387ef
You implemented almost everything that my PR was about, thanks!
But there are still two lines of changes remaining in my PR.

Would you look at this again? 

Explanation was written in PR description and in "Change 3" here https://github.com/llvm/llvm-project/pull/92652#issuecomment-2118852195

TLDR: 
Sometimes libc++ allocates 25 or 26 bytes for a string instead of 24. This is unnecessary, requires a runtime condition, and may potentially hide bugs from users.
This change doesn't affect API or ABI.

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


More information about the libcxx-commits mailing list