[libcxx-commits] [libcxx] Lower std::string's alignment requirement from 16 to 8. (PR #68807)

via libcxx-commits libcxx-commits at lists.llvm.org
Thu Oct 12 16:28:17 PDT 2023


================
@@ -133,6 +133,13 @@ ABI Affecting Changes
   results in an ABI break, however in practice we expect uses of ``std::projected`` in ABI-sensitive places to be
   extremely rare. Any error resulting from this change should result in a link-time error.
 
+- Under the unstable ABI, the internal alignment requirements for heap allocations
+  inside std::string has decreased from 16 to 8 This save memory since string requests fewer additional
+  bytes than it did previously. However, this also changes the return value of std::string::max_length
+  and can cause code compiled against older libc++ versions but linked at runtime to a new version
+  to thrown a different exception when attempting allocations that are too large
----------------
EricWF wrote:

Done.

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


More information about the libcxx-commits mailing list