[libcxx-commits] [libcxx] [libcxx] Allow string to use SSO in constant evaluation. (PR #66576)

via libcxx-commits libcxx-commits at lists.llvm.org
Sun Sep 17 21:20:54 PDT 2023


================
@@ -1969,7 +1955,8 @@ private:
                     allocator_type __a = __str.__alloc();
                     auto __allocation = std::__allocate_at_least(__a, __str.__get_long_cap());
                     __begin_lifetime(__allocation.ptr, __allocation.count);
-                    __alloc_traits::deallocate(__alloc(), __get_long_pointer(), __get_long_cap());
+                    if (__is_long())
+                        __alloc_traits::deallocate(__alloc(), __get_long_pointer(), __get_long_cap());
----------------
philnik777 wrote:

Why is this change required? AFAICT there should be no changes that affect the runtime.

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


More information about the libcxx-commits mailing list