[libcxx-commits] [libcxx] [libc++] Optimize vector growing of trivially relocatable types (PR #76657)

Louis Dionne via libcxx-commits libcxx-commits at lists.llvm.org
Thu Jan 11 09:59:29 PST 2024


================
@@ -982,37 +982,54 @@ template <ranges::input_range _Range,
 vector(from_range_t, _Range&&, _Alloc = _Alloc()) -> vector<ranges::range_value_t<_Range>, _Alloc>;
 #endif
 
+// __swap_out_circular_buffer relocates the objects in [__begin_, __end_) into the front of __v and swaps the buffers of
+// *this and __v. It is assumed that __v provides space for exactly (__end_ - __begin_) objects in the front. This
----------------
ldionne wrote:

In a followup NFC, we absolutely need to change the name of `__v` here to something like `__sb`, because `__v` implies that the variable is a vector, when in fact it isn't. Or `__temporary_buffer`, or anything else but not `__v`.

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


More information about the libcxx-commits mailing list