[libc++] Consider adding an `allocate_at_least`-like function to the new-family of functions
Open
libc++
performance
- Dominant language
- LLVM
- Stars
- 40.5k
- Forks
- 18.7k
- PR merge metrics
- PR metrics pending
Description
Currently `std::allocator`'s `allocate_at_least` simply allocates an exact amount of memory. Instead, we could introduce a function like `allocation_result __new_at_least(size_t count)` which uses platform-specific functions to do what `allocate_at_least` is intended for: returning the actual amount of memory allocated.
This would improve performance of e.g. `vector` and `string`, since they use `allocate_at_least` internally.
Contributor guide
Assessment
This issue has not been assessed yet.