[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 07:42:33 PST 2024


philnik777 wrote:

> I personally do not like the current solution, because `allocate_at_least` may end up allocating more memory than requested. Then we would have to immediately discard the newly allocated memory. If we revert back to `allocate`, we wouldn't have the problem.

The intention of `allocate_at_least` is that the allocator tells us how much it overallocated due to its allocation algorithm, not that it actually allocates more. If you implement the interface properly `allocate` will only hide the overallocation, not prevent it. 

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


More information about the libcxx-commits mailing list