gcc/libstdc++-v3/testsuite/25_algorithms
François Dumont ba23e045fc libstdc++: Limit memory allocation in stable_sort/inplace_merge (PR 83938)
Reduce memory allocation in stable_sort/inplace_merge algorithms to what is needed
by the implementation.

Co-authored-by: John Chang  <john.chang@samba.tv>

libstdc++-v3/ChangeLog:

	PR libstdc++/83938
	* include/bits/stl_tempbuf.h (get_temporary_buffer): Change __len
	computation in the loop to avoid truncation.
	* include/bits/stl_algo.h:
	(__inplace_merge): Take temporary buffer length from smallest range.
	(__stable_sort): Limit temporary buffer length.
	* testsuite/25_algorithms/inplace_merge/1.cc (test4): New.
	* testsuite/performance/25_algorithms/stable_sort.cc: Test stable_sort
	under different heap memory conditions.
	* testsuite/performance/25_algorithms/inplace_merge.cc: New test.
2020-11-20 22:25:04 +01:00
..
adjacent_find
advance/istreambuf_iterators
all_of libstdc++: Improve tests for constexpr algorithms 2020-10-29 14:47:18 +00:00
any_of libstdc++: Improve tests for constexpr algorithms 2020-10-29 14:47:18 +00:00
binary_search libstdc++: Improve tests for constexpr algorithms 2020-10-29 14:47:18 +00:00
clamp libstdc++: Ensure c++NN effective target present in all C++17 tests 2020-07-31 19:58:02 +01:00
copy libstdc++: Fix some ranges algos optimizations [PR95578] 2020-06-10 17:37:53 -04:00
copy_backward libstdc++: Improve tests for constexpr algorithms 2020-10-29 14:47:18 +00:00
copy_if
copy_n libstdc++: Specialize copy/copy_n for istreambuf_iterator and deque iterators 2020-06-04 22:27:47 +02:00
count libstdc++: Improve tests for constexpr algorithms 2020-10-29 14:47:18 +00:00
count_if
equal libstdc++: Improve tests for constexpr algorithms 2020-10-29 14:47:18 +00:00
equal_range libstdc++: Improve tests for constexpr algorithms 2020-10-29 14:47:18 +00:00
fill libstdc++: Improve tests for constexpr algorithms 2020-10-29 14:47:18 +00:00
fill_n libstdc++: Make byte-sized std::fill_n a constant expression (PR 94933) 2020-05-03 13:33:15 +01:00
find
find_end libstdc++: Improve tests for constexpr algorithms 2020-10-29 14:47:18 +00:00
find_first_of
find_if libstdc++: Improve tests for constexpr algorithms 2020-10-29 14:47:18 +00:00
find_if_not
for_each libstdc++: Mark some more algorithms constexpr for C++20 2020-09-21 20:48:17 -04:00
generate
generate_n c++: Implement -Wvexing-parse [PR25814] 2020-11-05 15:55:14 -05:00
headers
heap libstdc++: Avoid warnings in tests 2020-10-29 22:47:21 +00:00
includes
inplace_merge libstdc++: Limit memory allocation in stable_sort/inplace_merge (PR 83938) 2020-11-20 22:25:04 +01:00
is_heap
is_heap_until
is_partitioned libstdc++: Improve tests for constexpr algorithms 2020-10-29 14:47:18 +00:00
is_permutation libstdc++: Improve tests for constexpr algorithms 2020-10-29 14:47:18 +00:00
is_sorted
is_sorted_until libstdc++: Improve tests for constexpr algorithms 2020-10-29 14:47:18 +00:00
iter_swap
lexicographical_compare libstdc++: Improve tests for constexpr algorithms 2020-10-29 14:47:18 +00:00
lexicographical_compare_three_way
lower_bound libstdc++: Make _GLIBCXX_DEBUG checks constexpr compatible 2020-11-09 21:11:13 +01:00
make_heap
max
max_element
merge libstdc++: Improve tests for constexpr algorithms 2020-10-29 14:47:18 +00:00
min libstdc++: Make _GLIBCXX_CONCEPT_CHECKS more constexpr-friendly 2020-02-27 10:52:28 +00:00
min_element
minmax
minmax_element
mismatch libstdc++: Improve tests for constexpr algorithms 2020-10-29 14:47:18 +00:00
move libstdc++: Fix some ranges algos optimizations [PR95578] 2020-06-10 17:37:53 -04:00
move_backward libstdc++: Fix some ranges algos optimizations [PR95578] 2020-06-10 17:37:53 -04:00
next_permutation
none_of libstdc++: Improve tests for constexpr algorithms 2020-10-29 14:47:18 +00:00
nth_element
partial_sort libstdc++: -D_GLIBCXX_DEBUG fixes in the constrained algos tests 2020-02-27 12:47:17 -05:00
partial_sort_copy libstdc++: -D_GLIBCXX_DEBUG fixes in the constrained algos tests 2020-02-27 12:47:17 -05:00
partition
partition_copy libstdc++: Improve tests for constexpr algorithms 2020-10-29 14:47:18 +00:00
partition_point
pop_heap
prev_permutation
pstl libstdc++: Skip PSTL tests when installed TBB is too old [PR 96718] 2020-08-21 12:01:05 +01:00
push_heap
random_shuffle
remove
remove_copy libstdc++: Improve tests for constexpr algorithms 2020-10-29 14:47:18 +00:00
remove_copy_if libstdc++: Improve tests for constexpr algorithms 2020-10-29 14:47:18 +00:00
remove_if libstdc++: Improve tests for constexpr algorithms 2020-10-29 14:47:18 +00:00
replace
replace_copy
replace_copy_if
replace_if libstdc++: Improve tests for constexpr algorithms 2020-10-29 14:47:18 +00:00
reverse libstdc++: Improve tests for constexpr algorithms 2020-10-29 14:47:18 +00:00
reverse_copy libstdc++: Improve tests for constexpr algorithms 2020-10-29 14:47:18 +00:00
rotate
rotate_copy libstdc++: Improve tests for constexpr algorithms 2020-10-29 14:47:18 +00:00
sample libstdc++: Avoid warnings in tests 2020-10-29 22:47:21 +00:00
search libstdc++: Avoid warnings in tests 2020-10-29 22:47:21 +00:00
search_n libstdc++: Fix ranges::search_n for random access iterators [PR97828] 2020-11-17 10:28:20 -05:00
set_difference libstdc++: Improve tests for constexpr algorithms 2020-10-29 14:47:18 +00:00
set_intersection libstdc++: Improve tests for constexpr algorithms 2020-10-29 14:47:18 +00:00
set_symmetric_difference libstdc++: Improve tests for constexpr algorithms 2020-10-29 14:47:18 +00:00
set_union libstdc++: Improve tests for constexpr algorithms 2020-10-29 14:47:18 +00:00
shift_left libstdc++: P0769R2 Add shift to <algorithm> 2020-02-24 10:08:57 -05:00
shift_right libstdc++: P0769R2 Add shift to <algorithm> 2020-02-24 10:08:57 -05:00
shuffle libstdc++: -D_GLIBCXX_DEBUG fixes in the constrained algos tests 2020-02-27 12:47:17 -05:00
sort libstdc++: -D_GLIBCXX_DEBUG fixes in the constrained algos tests 2020-02-27 12:47:17 -05:00
sort_heap
stable_partition
stable_sort libstdc++: -D_GLIBCXX_DEBUG fixes in the constrained algos tests 2020-02-27 12:47:17 -05:00
swap
swap_ranges
transform
unique
unique_copy libstdc++: Improve tests for constexpr algorithms 2020-10-29 14:47:18 +00:00
upper_bound libstdc++: Make _GLIBCXX_DEBUG checks constexpr compatible 2020-11-09 21:11:13 +01:00
constexpr_macro.cc
cpp_lib_constexpr.cc