[libcxx-commits] [libcxx] [libcxx] optimize sized-based vector representation to reduce binary size (PR #216822)
Nikolas Klauser via libcxx-commits
libcxx-commits at lists.llvm.org
Tue Aug 18 00:00:51 PDT 2026
================
@@ -416,7 +416,9 @@ public:
auto __last = __first + __n;
std::__uninitialized_allocator_relocate(
__alloc_, std::__to_address(__first), std::__to_address(__last), std::__to_address(__new_begin));
- __set_valid_range(__new_begin, end());
+ __begin_ = __new_begin;
+ __size_ += __n;
+
__n = 0;
----------------
philnik777 wrote:
Why does this change anything? Can't you use the size overload of `__set_valid_range` instead?
https://github.com/llvm/llvm-project/pull/216822
More information about the libcxx-commits
mailing list