[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
Wed Aug 19 11:18:14 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:

I probably don't mind this as an NFC change, but I feel like a patch about improving performance shouldn't touch an entirely different file unnecessarily. (Though, I would like to note that your analysis completely ignores the _much_ more widely used stable ABI).

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


More information about the libcxx-commits mailing list