llvm-project/libcxx/test/libcxx
Eric Fiselier de3f2b396c Fix PR12999 - unordered_set::insert calls operator new when no insert occurs
Summary:
when `unordered_set::insert(value_type&&)` was called it would be treated like `unordered_set::emplace(Args&&)` and it would allocate and construct a node before trying to insert it.
This caused unnecessary allocations when the value was already in the set. This patch adds an overload to `__hash_table::__insert_unique` that specifically handles `value_type&&` more link `value_type const &`. 

This patch also adds a single unified insert function for values into  `__hash_table` called `__insert_unique_value` that handles the cases for `__insert_unique(value_type&&)` and `__insert_unique(value_type const &)`. 

This patch fixes PR12999: http://llvm.org/bugs/show_bug.cgi?id=12999.




Reviewers: mclow.lists, titus, danalbert

Reviewed By: danalbert

Subscribers: cfe-commits

Differential Revision: http://reviews.llvm.org/D7570

llvm-svn: 239666
2015-06-13 07:18:32 +00:00
..
containers/unord/unord.set Fix PR12999 - unordered_set::insert calls operator new when no insert occurs 2015-06-13 07:18:32 +00:00
experimental Implement std::experimental::sample. 2015-05-13 16:55:41 +00:00
selftest Add test macros header to remove dependance on __config macros. 2015-05-27 00:28:30 +00:00
test Address @danalberts comments on r237700 2015-05-19 23:10:32 +00:00
type_traits Mark __convert_to_integral test as XFAIL in c++03 2015-05-27 01:02:51 +00:00
__init__.py
compiler.py Add compiler flag test support to LIT. Fix new/delete tests on apple-clang. 2015-05-19 15:15:53 +00:00
double_include.sh.cpp Implement std::experimental::sample. 2015-05-13 16:55:41 +00:00
util.py [libcxx] Allow use of ShTest in libc++ tests along with other changes. 2015-01-22 18:05:58 +00:00