[libcxx-commits] [libcxx] [libcxx] Align `__recommend() + 1` by __endian_factor (PR #90292)

Chris Kennelly via libcxx-commits libcxx-commits at lists.llvm.org
Tue Jun 11 18:05:53 PDT 2024


ckennelly wrote:

I'm unable to say whether or not this is a problem for Google's codebase, since @alk speculated [upthread](https://github.com/llvm/llvm-project/pull/90292#issuecomment-2155502762) that it might be string ABI dependent.  I'll see if I can loop some folks in who would know.

Either way, sized deallocation is an important performance optimization in modern memory allocators to avoid a costly pointer-to-size lookup (in TCMalloc's case, a 2/3-level radix tree walk).  Passing the wrong size is UB and diagnosed by ASan as such, and in practice means we might place the deallocated object on the wrong freelist.

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


More information about the libcxx-commits mailing list