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

James Y Knight via libcxx-commits libcxx-commits at lists.llvm.org
Thu May 2 12:08:23 PDT 2024


jyknight wrote:

> Hm, then as-is custom allocator can return more, but if allocator needs correct value for __alloc_traits::deallocate, `allocate` suppose to return size magically aligned.

As long we ensure the size passed to deallocate is both:
* `>=` requested allocation size, and
* `<=` returned allocation size

then an allocator must accept that value. Therefore, storing a size which is the returned allocation size rounded-down to an even number, as long as we ensured the requested allocation size was even.

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


More information about the libcxx-commits mailing list