[all-commits] [llvm/llvm-project] 4562ef: Reapply "[libc++] Simplify the implementation of r...

Nikolas Klauser via All-commits all-commits at lists.llvm.org
Thu Feb 6 00:35:46 PST 2025


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 4562efc674a5b5e052abdfc40047e82a359d0df0
      https://github.com/llvm/llvm-project/commit/4562efc674a5b5e052abdfc40047e82a359d0df0
  Author: Nikolas Klauser <nikolasklauser at berlin.de>
  Date:   2025-02-06 (Thu, 06 Feb 2025)

  Changed paths:
    M libcxx/include/string
    M libcxx/test/std/strings/basic.string/string.capacity/reserve_size.pass.cpp

  Log Message:
  -----------
  Reapply "[libc++] Simplify the implementation of reserve() and shrink_to_fit() (#113453)" (#125888)

The capacity is now passed correctly and a test for this path is added.

Since we changed the implementation of `reserve(size_type)` to only ever
extend,
it doesn't make a ton of sense anymore to have `__shrink_or_extend`,
since the code
paths of `reserve` and `shrink_to_fit` are now almost completely
separate.

This patch splits up `__shrink_or_extend` so that the individual parts
are in `reserve`
and `shrink_to_fit` depending on where they are needed.

This reverts commit 59f57be94f38758616b1339b293b43af845571af.



To unsubscribe from these emails, change your notification settings at https://github.com/llvm/llvm-project/settings/notifications


More information about the All-commits mailing list