[libcxx-commits] [libcxx] [libc++][test] Fix increasing_allocator to meet `Cpp17Allocator` requirements (PR #115671)

Peng Liu via libcxx-commits libcxx-commits at lists.llvm.org
Wed Nov 13 07:25:37 PST 2024


winner245 wrote:

Thank you all for the very informative discussions here. I agree that the current solution for `shrink_to_fit` is the best compromise we have at this point. In response to @philnik777's comment that "allocate will only hide the overallocation, not prevent it," I think this PR now serves as a refactoring:

- Currently, the `increasing_allocator<T>` class appears in three different files. We should factor it out into a single location.
- Semantically, it makes more sense to let `allocate()` call `std::allocator::allocate`, not `allocate_at_least` (and  let `allocate_at_least()` call `std::allocator::allocate_at_least`).

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


More information about the libcxx-commits mailing list