diff options
author | danakj@chromium.org <danakj@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-09-25 01:05:00 +0000 |
---|---|---|
committer | danakj@chromium.org <danakj@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-09-25 01:05:00 +0000 |
commit | e7a765c9ad82e7c52661ebd143f30ef827e1f7cb (patch) | |
tree | 13cf24c597e9c47494dbda8f18bff2dfa182d3be /cc/cc_tests.gyp | |
parent | 3f4771d08156c8d19b28c6802186acec29c56e16 (diff) | |
download | chromium_src-e7a765c9ad82e7c52661ebd143f30ef827e1f7cb.zip chromium_src-e7a765c9ad82e7c52661ebd143f30ef827e1f7cb.tar.gz chromium_src-e7a765c9ad82e7c52661ebd143f30ef827e1f7cb.tar.bz2 |
Add methods for hashing pairs of integer values.
This will allow us to create hash_maps that are keyed off of std::pair objects
holding two integer values.
When both integers are at most 32-bits we can use 64-bit multiplication to
efficiently find the hash code. When one of the integers is 64-bit, then
we split the two values in the pair into 4 32-bit integers.
References to the algorithms used are contained in comments within the code.
These algorithms are similar to the hash function recently added to WebKit
in https://bugs.webkit.org/show_bug.cgi?id=96022, however since our hash codes
are of type size_t (theirs are unsigned) which is 64 bits large on some
platforms, we can be more efficient and not have to reduce the hash code to 32
bits on some platforms.
Tested by cc_unittests: HashPairTest.IntegerPairs.
BUG=149870
Review URL: https://chromiumcodereview.appspot.com/10911330
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@158479 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'cc/cc_tests.gyp')
-rw-r--r-- | cc/cc_tests.gyp | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/cc/cc_tests.gyp b/cc/cc_tests.gyp index 8d9800c..8b724e7 100644 --- a/cc/cc_tests.gyp +++ b/cc/cc_tests.gyp @@ -7,6 +7,7 @@ 'chromium_code': 0, 'use_libcc_for_compositor%': 0, 'cc_tests_source_files': [ + 'hash_pair_unittest.cc', 'CCActiveAnimationTest.cpp', 'CCDamageTrackerTest.cpp', 'CCDelayBasedTimeSourceTest.cpp', |