mirror of
https://gcc.gnu.org/git/gcc.git
synced 2024-12-20 17:44:53 +08:00
ba23e045fc
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. |
||
---|---|---|
.. | ||
20_util/memory_resource | ||
21_strings | ||
22_locale | ||
23_containers | ||
25_algorithms | ||
26_numerics | ||
27_io | ||
28_regex | ||
30_threads/future | ||
ext/pb_ds |