mirror-llvm-project/libcxx/utils/gdb/libcxx
Christopher Di Bella bd338806e4
[libc++] Add a size-based representation for vector in the unstable ABI (#155330)
This commit adds an alternative representation for `std::vector` in a similar
manner to `__split_buffer` in #139632. This alternative representation was
measured to provide significant performance gains over the classic representation.

To do so, we introduce a layout type that tracks implementation details that
differ between the pointer-based vector and size-based vector representations.
`vector` does not parameterise its layout type, unlike `__split_buffer`.
`__split_buffer` is used by both `vector` and `deque`, and being able to take
an ABI break on `vector` doesn't automatically mean that users can also tolerate
a break on `deque`.

This new vector representation can be opted into by defining the
_LIBCPP_ABI_VECTOR_LAYOUT_SIZE_BASED macro when configuring the
library's ABI.

This change was the target of this RFC: https://discourse.llvm.org/t/adding-a-size-based-vector-to-libc-s-unstable-abi
2026-07-01 15:12:36 -04:00
..
printers.py [libc++] Add a size-based representation for vector in the unstable ABI (#155330) 2026-07-01 15:12:36 -04:00