[all-commits] [llvm/llvm-project] 4a68e4: [libc++] Fix throwing away smaller allocations in ...
Nikolas Klauser via All-commits
all-commits at lists.llvm.org
Mon Nov 11 08:16:37 PST 2024
Branch: refs/heads/main
Home: https://github.com/llvm/llvm-project
Commit: 4a68e4cbd2423dcacada8162ab7c4bb8d7f7e2cf
https://github.com/llvm/llvm-project/commit/4a68e4cbd2423dcacada8162ab7c4bb8d7f7e2cf
Author: Nikolas Klauser <nikolasklauser at berlin.de>
Date: 2024-11-11 (Mon, 11 Nov 2024)
Changed paths:
M libcxx/include/string
A libcxx/test/libcxx/strings/basic.string/string.capacity/shrink_to_fit.pass.cpp
Log Message:
-----------
[libc++] Fix throwing away smaller allocations in string::shrink_to_fit (#115659)
Currently `string::shrink_to_fit()` throws away any allocations which
return more capacity than we requested, even if that allocation is still
smaller than the current capacity. This patch fixes this to compare the
returned allocation against the current capacity of the string instead
of against the requested capacity.
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