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

Nikolas Klauser via libcxx-commits libcxx-commits at lists.llvm.org
Mon Nov 11 06:45:10 PST 2024


philnik777 wrote:

I feel like the reasoning is backwards here. AFAICT the only problem is that we're mismatching the `n` we pass to `allocator::deallocate` with the `n` we're passing to `allocator::allocate`. Nothing requires that there is space for exactly n elements in an allocation - there has to be space for at least that. In fact, most allocators return more than the requested amount in at least some cases, which is the whole reason `allocate_at_least` was introduced.

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


More information about the libcxx-commits mailing list