[all-commits] [llvm/llvm-project] 5de1bc: [🍒] Unconditionally lower std::string's alignment ...
Eric via All-commits
all-commits at lists.llvm.org
Tue Feb 6 17:01:50 PST 2024
Branch: refs/heads/release/18.x
Home: https://github.com/llvm/llvm-project
Commit: 5de1bcb70db21cfd2c28ef70c67fd1833ce1e6da
https://github.com/llvm/llvm-project/commit/5de1bcb70db21cfd2c28ef70c67fd1833ce1e6da
Author: Eric <eric at efcs.ca>
Date: 2024-02-06 (Tue, 06 Feb 2024)
Changed paths:
M libcxx/docs/ReleaseNotes/18.rst
M libcxx/include/__config
M libcxx/include/string
M libcxx/test/libcxx/strings/basic.string/string.capacity/allocation_size.pass.cpp
M libcxx/test/libcxx/strings/basic.string/string.capacity/max_size.pass.cpp
M libcxx/test/std/strings/basic.string/string.capacity/max_size.pass.cpp
Log Message:
-----------
[🍒] Unconditionally lower std::string's alignment requirement from 16 to 8 (#68925) (#79480)
This change saves memory by providing the allocator more freedom to
allocate the most
efficient size class by dropping the alignment requirements for
std::string's
pointer from 16 to 8. This changes the output of std::string::max_size,
which makes it ABI breaking.
That said, the discussion concluded that we don't care about this ABI
break. and would like this change enabled universally.
The ABI break isn't one of layout or "class size", but rather the value
of "max_size()" changes, which in turn changes whether `std::bad_alloc`
or `std::length_error` is thrown for large allocations.
This change is the child of PR #68807, which enabled the change behind
an ABI flag.
More information about the All-commits
mailing list