[libcxx-commits] [libcxx] [libcxx] Align allocation to match `__set_long_cap` and `__get_long_cap` (PR #90292)
Nikolas Klauser via libcxx-commits
libcxx-commits at lists.llvm.org
Tue Apr 30 10:50:24 PDT 2024
philnik777 wrote:
> > BTW it's expected that there might be a byte dropped if the allocator returns more than what we asked for. That's completely legal for us to do. (But I don't think we test that for `string`, so it shouldn't affect the tests)
>
> Hm, I would expect allocator should still accept the same size for new/delete, even if it returns more. Otherwise using those operators will be very annoying.
Yes, it does. With `allocate_at_least` you can give it anything between the requested size and the actually allocated size. Because of that it's fine for us to drop a byte that's been promised by the allocator.
https://github.com/llvm/llvm-project/pull/90292
More information about the libcxx-commits
mailing list