summaryrefslogtreecommitdiffstats
path: root/libcxx/test/containers/unord/unord.map/reserve.pass.cpp
Commit message (Collapse)AuthorAgeFilesLines
* Move test into test/std subdirectory.Eric Fiselier2014-12-201-91/+0
| | | | llvm-svn: 224658
* There were two identical files named 'min_allocator.h'. Move one of them to ↵Marshall Clow2013-11-261-1/+1
| | | | | | /support and delete the other. Then adjust all the tests that used them to include the moved one. No functionality change. llvm-svn: 195785
* Implement full support for non-pointer types in custom allocators. This is ↵Howard Hinnant2013-06-221-1/+33
| | | | | | for the unordered containers only. This work still needs to be done on the sequence containers. llvm-svn: 184635
* This commit establishes a new bucket_count policy in the unordered ↵Howard Hinnant2012-07-061-1/+1
| | | | | | containers: The policy now allows a power-of-2 number of buckets to be requested (and that request honored) by the client. And if the number of buckets is set to a power of 2, then the constraint of the hash to the number of buckets uses & instead of %. If the client does not specify a number of buckets, then the policy remains unchanged: a prime number of buckets is selected. The growth policy is that the number of buckets is roughly doubled when needed. While growing, either the prime, or the power-of-2 strategy will be preserved. There is a small run time cost for putting in this switch. For very cheap hash functions, e.g. identity for int, the cost can be as high as 18%. However with more typical use cases, e.g. strings, the cost is in the noise level. I've measured cases with very cheap hash functions (int) that using a power-of-2 number of buckets can make look up about twice as fast. However I've also noted that a power-of-2 number of buckets is more susceptible to accidental catastrophic collisions. Though I've also noted that accidental catastrophic collisions are also possible when using a prime number of buckets (but seems far less likely). In short, this patch adds an extra tuning knob for those clients trying to get the last bit of performance squeezed out of their hash containers. Casual users of the hash containers will not notice the introduction of this tuning knob. Those clients who swear by power-of-2 hash containers can now opt-in to that strategy. Clients who prefer a prime number of buckets can continue as they have. llvm-svn: 159836
* license changeHoward Hinnant2010-11-161-2/+2
| | | | llvm-svn: 119395
* Wiped out some non-ascii characters that snuck into the copyright.Howard Hinnant2010-05-111-1/+1
| | | | llvm-svn: 103516
* libcxx initial importHoward Hinnant2010-05-111-0/+59
llvm-svn: 103490
OpenPOWER on IntegriCloud