summaryrefslogtreecommitdiff
path: root/absl/hash
Commit message (Collapse)AuthorAge
* Do not make std::filesystem::path hash available for macOS <10.15Gravatar Abseil Team2024-05-29
| | | | | | | | C++17 <filesystem> is only available on macOS 10.15 and newer, so do not enable this feature on older versions. PiperOrigin-RevId: 638348906 Change-Id: I5e12db47513f7f8aeb9e55a3e253c866ec046d47
* Optimize LowLevelHash by breaking dependency between final loads and ↵Gravatar Connal de Souza2024-03-28
| | | | | | | | | previous len/ptr updates. No functional change. PiperOrigin-RevId: 619979819 Change-Id: I71a4ae14272bcdf1da2e201ed286f95213ecb5e2
* Remove redundant semicolons introduced by macrosGravatar Abseil Team2024-03-15
| | | | | PiperOrigin-RevId: 616083064 Change-Id: I3d69303d32431227c197247682f8dcb70f9a239d
* Fix GCC7 C++17 buildGravatar Derek Mauro2024-03-12
| | | | | | | | | GCC did not support <filesystem> until GCC8. Fixes #1635 PiperOrigin-RevId: 615051227 Change-Id: If7cd5802ead40805b1ff1c3bdfc10ba6d2858ef0
* Optimize `absl::Hash` by making `LowLevelHash` faster.Gravatar Shahriar Rouf2024-02-07
| | | | | | | | | | | | | | | | Throughput of the 64 byte chunk loop inside `LowLevelHash` (or now in `LowLevelHashLenGt16`) gets limited by the loop carried dependency on `current_state`. By using 4 states instead of 2, we can reduce this duration by 1 cycle. On Skylake, it is reduced from 9 cycles to 8 cycles (12.5% faster asymptotically). To see the reduction in a simplified version of `LowLevelHash` implementation on Skylake: * Before: https://godbolt.org/z/Tcj9vsGax, llvm-mca (https://godbolt.org/z/3o78Msr63) shows 9 cycles / iteration. * After: https://godbolt.org/z/q4GM4EjPr, llvm-mca (https://godbolt.org/z/W5d1KEMzq) shows 8 cycles / iteration. * This CL is removing 1 xor (1 cycle) per iteration from the critical path. A block for 32 byte chunk is also added. Finally, just before returning, `Mix` is called 1 time instead of twice. PiperOrigin-RevId: 605090653 Change-Id: Ib7517ebb8bef7484066cd14cf41a943953e93377
* Replace `testonly = 1` with `testonly = True` in abseil BUILD files.Gravatar Shahriar Rouf2024-01-31
| | | | | | | https://bazel.build/build/style-guide#other-conventions PiperOrigin-RevId: 603084345 Change-Id: Ibd7c9573d820f88059d12c46ff82d7d322d002ae
* Fix a corner case in SpyHashState for exact boundaries.Gravatar Matt Kulukundis2024-01-29
| | | | | | | AbslHash allows for piecewise chunks to be streamed incrementally into hash states and requires them to hash identically to one giant stream. The exact size window for this is an internal details `PiecewiseChunkSize`. There was an off by one error in this code. Add tests and fix it. PiperOrigin-RevId: 602463183 Change-Id: I159bbb5e7e745f55b2fe6eaf0d2735bd0a08aca9
* Fix codegen trunks in `absl/hash/hash_benchmark.cc`.Gravatar Shahriar Rouf2023-12-05
| | | | | PiperOrigin-RevId: 588121665 Change-Id: Id057772e426aefe2fe7b2f1e94fd405b97167fed
* Avoid AbslHashValue for std::filesystem::path when <filesystem> is not includedGravatar Abseil Team2023-11-22
| | | | | PiperOrigin-RevId: 584675181 Change-Id: I78c9a29055327c84f1e78b8440221439839a041c
* Respect libc++ config option for disable of filesystemGravatar Abseil Team2023-11-17
| | | | | | | - libc++ throws errors when filesystem is included when disabled PiperOrigin-RevId: 583474609 Change-Id: I205edc5c508f12b84244912f9acc47308a8ca540
* Provide AbslHashValue for std::filesystem::path in C++17Gravatar Derek Mauro2023-11-17
| | | | | | | | | | | | | | | | | | This is somewhat tricky to implement because path equality is not straightforward. See https://github.com/abseil/abseil-cpp/pull/1560#issuecomment-1799983471 for discussion. This re-lands 3bd86026c93da5a40006fd53403dff9d5f5e30e3 with a fix for iOS 13 unavailability of std::filesystem::path. Roll-forward of 524ebb7ea91d2955dc4c68c7e6fd2bed620621b5. Closes #655 Closes #1560 PiperOrigin-RevId: 583365100 Change-Id: Id49735c49d123e0cd6a620a2b5b5a12d94129f94
* Rollback providing AbslHashValue for std::filesystem::path in C++17Gravatar Derek Mauro2023-11-16
| | | | | | | 'path' is unavailable: introduced in iOS 13.0 PiperOrigin-RevId: 583036562 Change-Id: I5aea530d03c3317896c3c15bcf7cb5f9d8bc466a
* Provide AbslHashValue for std::filesystem::path in C++17Gravatar Derek Mauro2023-11-15
| | | | | | | | | | | | | This is somewhat tricky to implement because path equality is not straightforward. See https://github.com/abseil/abseil-cpp/pull/1560#issuecomment-1799983471 for discussion. Closes #655 Closes #1560 PiperOrigin-RevId: 582863821 Change-Id: I03517a7f2003614c027c786abbfb91b6571ab662
* Don't allow AbslHashValue() to take a C-style array parameter. TheGravatar Derek Mauro2023-11-14
| | | | | | | | | | | | | | | | | | | current behavior of decaying the array to a pointer and hashing the pointer can lead to subtle bugs. The most common potential error is passing a C-string literal. Hashing the char pointer in those cases is correct only if the string literals are guaranteed to be deduplicated, which is dangerous to rely on even if true (and the call sites in header files require deduplication across translation units). After this change, these call-sites requires wrapping the literal in absl::string_view. This is a breaking change for code doing something like absl::HashOf("string"); Instead, this should be changed to absl::HashOf(absl::string_view("string")); PiperOrigin-RevId: 582393585 Change-Id: I3810c07b5b74bf153cb62a7beedce243be5a69ee
* PR #1559: Fix comparison of integer expressions of different signedness warningGravatar Alexander Ignatyev2023-11-02
| | | | | | | | | | | | | | | | | | Imported from GitHub PR https://github.com/abseil/abseil-cpp/pull/1559 ``` //absl/hash/internal/hash.h:633:21: error: comparison of integer expressions of different signedness: 'int' and 'long unsigned int' [-Werror=sign-compare] ``` This warning is specific to the hashing of `std::bitset<>` on Big Endian platforms such as s390x Merge 3f34d808c8689ffa47a798112ab44c0e3b32faa4 into 065d50d9f835cce8e4ee8f6d595518c409669901 Merging this change closes #1559 COPYBARA_INTEGRATE_REVIEW=https://github.com/abseil/abseil-cpp/pull/1559 from aligusnet:20211102.0-mongo 3f34d808c8689ffa47a798112ab44c0e3b32faa4 PiperOrigin-RevId: 578897545 Change-Id: Ifd1c947af3ad01e8e2a6241030ed29fb00842d53
* Bazel: Enable the header_modules featureGravatar Derek Mauro2023-10-11
| | | | | PiperOrigin-RevId: 572575394 Change-Id: Ic1c5ac2423b1634e50c43bad6daa14e82a8f3e2c
* Bazel: Support layering_check and parse_headersGravatar Derek Mauro2023-10-10
| | | | | | | | | | | | | The layering_check feature ensures that rules that include a header explicitly depend on a rule that exports that header. Compiler support is required, and currently only Clang 16+ supports diagnoses layering_check failures. The parse_headers feature ensures headers are self-contained by compiling them with -fsyntax-only on supported compilers. PiperOrigin-RevId: 572350144 Change-Id: I37297f761566d686d9dd58d318979d688b7e36d1
* Fix typo hash_test.cc -> hash_instantiated_test.cc fromGravatar Derek Mauro2023-08-17
| | | | | | | | | | c154d20abce2f1ae6bd35bd774313e351493219b and add CMake dependency on gmock #1515 PiperOrigin-RevId: 557897123 Change-Id: I3f8bbcea1f4c293e073e1f77dbbf818ce2b167bd
* Include what you spellGravatar Dmitri Gribenko2023-08-11
| | | | | PiperOrigin-RevId: 555894810 Change-Id: I349c94e7c6e7ba1dbd817aa8e4340c1dada84654
* Adding sw prefetchers to absl::hash.Gravatar Abseil Team2023-07-13
| | | | | PiperOrigin-RevId: 547850162 Change-Id: I43208c7fa1eaa2a7acfad5891b80c150ee58c65f
* Split absl/hash/hash_test.cc into two filesGravatar Benjamin Barenblat2023-05-25
| | | | | | | | | | hash_test.cc leans heavily on INSTANTIATE_TYPED_TEST_SUITE_P, which is quite memory- and CPU-hungry. Split a few heavyweight tests into a new hash_instantiated_test.cc, reducing peak RAM consumption (or, on multicore systems, compilation time). PiperOrigin-RevId: 535305679 Change-Id: Ic204da0a47c749c3f7db5f902ade8d74ed3043bb
* trivial: format some files using clang-formatGravatar Patrick Xia2023-04-27
| | | | | PiperOrigin-RevId: 527598377 Change-Id: I0ae1505db595b7f3a420f2f608c6e02f8800f138
* Fix some spelling mistakesGravatar Vertexwahn2023-04-24
|
* `AbslHashValue()` applied to a C-style array simply decays the array to a ↵Gravatar Abseil Team2023-04-20
| | | | | | | pointer and hashes that, which is very unlikely to be what the author intended. PiperOrigin-RevId: 525923741 Change-Id: I876dbde341f0b0642fa3d10e3f67b0b31d0311bf
* Hash support for std::wstring_view/u16string_view/u32string_viewGravatar Abseil Team2023-03-24
| | | | | PiperOrigin-RevId: 519200954 Change-Id: I349023cacab0ac4cbefb8505efd29a5eda1e9067
* [absl] Update documentation to reflect hash support for std::wstring, ↵Gravatar Lawrence Wolf-Sonkin2023-03-10
| | | | | | | std::u16string and std::u32stringstrings PiperOrigin-RevId: 515726337 Change-Id: I08e184ec1f7169835c034ac45a7e87293dc53078
* Merge pull request #1388 from miladfarca:fix-Read1To3-on-BEGravatar Copybara-Service2023-02-22
|\ | | | | | | | | PiperOrigin-RevId: 511499093 Change-Id: I9ea2bbc38cbe8bd9dae937626d8faac41c010b38
* \ Merge pull request #1401 from AtariDreams:appleGravatar Copybara-Service2023-02-21
|\ \ | | | | | | | | | | | | PiperOrigin-RevId: 511270860 Change-Id: Ib7de8c72505bf141d450f950074a27f9f4f1613c
| * | Remove check for apple_build_version for hash workaroundGravatar Rose2023-02-21
|/ / | | | | | | Apple's clang fork has the missing commit now, and we can safely use the above codepath.
| * Fix Read1To3 on big EndianGravatar Milad Fa2023-02-15
|/
* Fix a discrepancy between absl::Hash and absl::HashOf for some negative ↵Gravatar Abseil Team2023-02-06
| | | | | | | signed integral types and improve the performance of absl::Hash. PiperOrigin-RevId: 507598042 Change-Id: I96a7bd6b9c360f435f216b2671ae84d9768a46e8
* Tweak the compilation condition for IsHashableTest.PoisonHashGravatar Derek Mauro2023-01-17
| | | | | | | #1359 PiperOrigin-RevId: 502597369 Change-Id: I5d65ed7e2dbe4b51ebce47f282ead89d91d919cd
* Replace absl::Hash for inputs from 9 to 16 bytes according to AlphaZero findingsGravatar Abseil Team2023-01-07
| | | | | PiperOrigin-RevId: 500401844 Change-Id: I6d0909a8e395c914861dd034824a34737a52d71f
* Eliminate AArch64-specific code paths from LowLevelHashGravatar Benjamin Barenblat2022-12-08
| | | | | | | | | | | | | | After internal investigation, it’s no longer clear that the alternative LowLevelHash mixer committed in a05366d851c5cb88065272f951e03955197e7c11 unequivocally improves performance on AArch64. It unnecessarily reduces performance on Apple Silicon and the AWS Graviton. It also lowers hash quality, which offsets much of the performance gain it provides on the Arm Neoverse N1 (see https://github.com/abseil/abseil-cpp/issues/1093). Switch back to the original mixer. Closes: https://github.com/abseil/abseil-cpp/issues/1093 PiperOrigin-RevId: 493941913 Change-Id: I84c789b2f88c91dec22f6f0f6e8c5129d2939a6f
* CMake: Mark absl::cord_test_helpers and absl::spy_hash_state PUBLICGravatar Abseil Team2022-10-03
| | | | | PiperOrigin-RevId: 478611460 Change-Id: I327dbd1c16a22649e3a25b9ebbc94b48a2fda26f
* Fix "unsafe narrowing" warnings in absl, 10/n.Gravatar Abseil Team2022-09-08
| | | | | | | | | | | | | | | Addresses failures with the following, in some files: -Wshorten-64-to-32 -Wimplicit-int-conversion -Wsign-compare -Wsign-conversion -Wtautological-unsigned-zero-compare (This specific CL focuses on tests.) Bug: chromium:1292951 PiperOrigin-RevId: 473055916 Change-Id: I40cdd6c87ba9d0a5fb2db5746cff04f14ee829c2
* CMake: Mark hash_testing as a public testonly library, as it is with BazelGravatar Derek Mauro2022-09-02
| | | | | PiperOrigin-RevId: 471833563 Change-Id: Ida281308afab67e73b2da61418e82b22c2110ef9
* Workaround bug in GCC 7.2Gravatar Jonathan Conder2022-08-12
| | | | | | See https://gcc.gnu.org/bugzilla/show_bug.cgi?id=83830. Before GCC 7.4, __cpp_lib_has_unique_object_representations was defined but has_unique_object_representations_v was not.
* Fix "unsafe narrowing" warnings in absl, 2/n.Gravatar Abseil Team2022-08-01
| | | | | | | | | | | | | | | Addresses failures with the following, in some files: -Wshorten-64-to-32 -Wimplicit-int-conversion -Wsign-compare -Wsign-conversion -Wtautological-unsigned-zero-compare (This specific CL focuses on .cc files in dirs a-h.) Bug: chromium:1292951 PiperOrigin-RevId: 464541951 Change-Id: If23b63ccea8e9b730159ff1c7288e9300a40b6bd
* Fix -Warray-parameter warningGravatar Abseil Team2022-07-13
| | | | | | | | | | Clang recently added this warning which flags inconsistencies between array parameters in function declarations. See https://crbug.com/1343303 PiperOrigin-RevId: 460725261 Change-Id: I57b1e99f13698c947e948c6024e3f6f4642ea189
* Export of internal Abseil changesGravatar Abseil Team2022-04-12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | -- f4c7e510922668c68be4aa79a00867c3d3ca9f95 by Derek Mauro <dmauro@google.com>: Many improvements to LeakChecker builds The presence of the LeakChecker is now detected when possible. GCC users using LeakChecker in standalone mode still need to use -DLEAK_CHECKER. This is now documented in the header. The hacky targets used for testing leak checking have been removed in favor of testing in AddressSanitizer mode on Kokoro. Fixes #885 Fixes #1153 PiperOrigin-RevId: 441203393 Change-Id: Ibe64ef6b104bcaf31839ff7184e558cc86abdd1c -- 5c70a23aa83b8152ab95d2cf21662fc63c80ef7d by Abseil Team <absl-team@google.com>: Add a benchmark for stacktrace PiperOrigin-RevId: 441196473 Change-Id: I4c9aa2e797aa2cae09abfaaee3abe5c09eb62fc4 -- 50b406052273b9d5bad04a7860a96e4d5d956c02 by Abseil Team <absl-team@google.com>: Internal change. PiperOrigin-RevId: 441114481 Change-Id: I667af7a50d5631ca91289dd24c91ba90233e0184 -- 568b4eaac120b420bce5290179d407d2b57d5bae by Dino Radakovic <dinor@google.com>: Internal change PiperOrigin-RevId: 440894155 Change-Id: Ia587ffc65a8321126585fb363b7c0ca8cc2a0da2 -- d53948eace4f3a10ac5a6c1496dc51b81adc412c by Abseil Team <absl-team@google.com>: Explicitly give internal linkage to symbols which are not used outside of their translation units. PiperOrigin-RevId: 440424519 Change-Id: I531c5e229d443375483b7550a34f48042589a99b GitOrigin-RevId: f4c7e510922668c68be4aa79a00867c3d3ca9f95
* Export of internal Abseil changesGravatar Abseil Team2022-04-04
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | -- afa44fa0245a1cfb1824ef9697b3fa77fa9615c9 by Laramie Leavitt <lar@google.com>: Comment CMakeLists.txt about internal absl_cc_library() targets. From what I can tell, these are the CMake targets that are public: absl::algorithm absl::algorithm_container absl::base absl::core_headers absl::dynamic_annotations absl::log_severity absl::cleanup absl::btree absl::fixed_array absl::flat_hash_map absl::flat_hash_set absl::inlined_vector absl::node_hash_map absl::node_hash_set absl::debugging absl::failure_signal_handler absl::leak_check absl::leak_check_disable absl::stacktrace absl::symbolize absl::flags absl::flags_commandlineflag absl::flags_config absl::flags_marshalling absl::flags_parse absl::flags_reflection absl::flags_usage absl::bind_front absl::function_ref absl::hash absl::hash_testing absl::memory absl::meta absl::type_traits absl::bits absl::int128 absl::numeric absl::numeric_representation absl::exponential_biased absl::periodic_sampler absl::sample_recorder absl::random_bit_gen_ref absl::random_distributions absl::random_mocking_bit_gen absl::random_random absl::random_seed_gen_exception absl::random_seed_sequences absl::status absl::statusor absl::cord absl::cord_test_helpers absl::str_format absl::strings absl::synchronization absl::civil_time absl::time absl::time_zone absl::any absl::bad_any_cast absl::bad_optional_access absl::bad_variant_access absl::compare absl::optional absl::span absl::variant absl::utility PiperOrigin-RevId: 438702788 Change-Id: Icf611c35e88f03cd2493a95f61617605305d4e8e -- a99f60847578e6c0df6befadb29a01c86def0d21 by Abseil Team <absl-team@google.com>: Internal change PiperOrigin-RevId: 438647928 Change-Id: I141eadd17d6e8607df25ebc893aecefa0239a72f -- b23e77e8f62a77023188594390c9e491c507d22c by Abseil Team <absl-team@google.com>: Internal change PiperOrigin-RevId: 438628502 Change-Id: I40c4297716c8c1621ba8b02a22393bfcbefb5b5e GitOrigin-RevId: afa44fa0245a1cfb1824ef9697b3fa77fa9615c9
* Replace the implementation of the Mix function in arm64 back to 128bit ↵Gravatar Ren Zibei2022-03-28
| | | | multiplication (#1094)
* Export of internal Abseil changesGravatar Abseil Team2022-03-15
| | | | | | | | | | | | | | | | | | | | | | | | | -- 5dc885f2b62993bccf33a3f3b99f7e460c819c89 by Derek Mauro <dmauro@google.com>: Remove the internal-only ABSL_INTERNAL_ASSUME now that ABSL_ASSUME is available and ABSL_INTERNAL_ASSUME has no more users. Improve the documentation to ABSL_ASSUME somewhat. PiperOrigin-RevId: 434803125 Change-Id: I7c27418463ffc1c7e10ecd50e2d17f348f686af7 -- 4aea19a0ef596228c9136a4c2446e6f25085f23c by Derek Mauro <dmauro@google.com>: Update documentation to warn against using absl::Hash across dynamically loaded libraries Fixes #1128 PiperOrigin-RevId: 434723247 Change-Id: Ib0c7ba03b2cab98b42e19e85be6833192d4b4067 GitOrigin-RevId: 5dc885f2b62993bccf33a3f3b99f7e460c819c89
* Export of internal Abseil changesGravatar Abseil Team2022-03-02
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | -- f0b7d230a90c82c6fee7adcb46a213d2582b6a7b by Martijn Vels <mvels@google.com>: Optimize substring logic now that CONCAT is removed This CL adds a static Substring() method to CordRepSubstring, and implements substring logic in cord.cc in terms of the new function. This cleans up various helper functions and logic remaining from previous complex CONCAT logic that is no longer needed. PiperOrigin-RevId: 431756805 Change-Id: I39c875b5af119916780e68598c7fc619fb2e8476 -- fa7d1bedf0e1244303844869a332c2a5dbd9ac0f by Derek Mauro <dmauro@google.com>: Allow macro expansion within ABSL_FLAG and ABSL_DECLARE_FLAG args PiperOrigin-RevId: 431721184 Change-Id: I6e19713fb541205d796f940998db5ee25178d55e -- 1b328badd92304ed1c634f23e1c191be57b7bb15 by Laramie Leavitt <lar@google.com>: Add #include for std:: types PiperOrigin-RevId: 431546757 Change-Id: I75efbcd3c77e6f53e4db66494101d30d670d988e -- e25323b299d4d3840218702860f537cdd2a3926f by Thomas Köppe <tkoeppe@google.com>: Add hashing support for pointers to member. Also add tests for function pointers to the existing "pointer" test. PiperOrigin-RevId: 431067588 Change-Id: I3686010635d9fee34c47a418b72402e10737cdbc -- ab27b012a61cf10109fd51932b3b0b05ee78f32f by Laramie Leavitt <lar@google.com>: Avoid use of std::pow in ChiSquare test. PiperOrigin-RevId: 431015830 Change-Id: Idd767ff2f51009ee171de48757207b38330ffea3 -- 28c359135d89061177958580fe4a7493802499cb by Laramie Leavitt <lar@google.com>: Add #include <type_traits> for std::false_type PiperOrigin-RevId: 431005757 Change-Id: I85a6a918778601e19512aaea744424cf39018521 -- a920730f23669479d92e3a696d65d0bc3a5b1de1 by Laramie Leavitt <lar@google.com>: #include <utility> for std::declval PiperOrigin-RevId: 431004934 Change-Id: I295237b2d44e9a15e4083698ea121b68ce0a1bb7 GitOrigin-RevId: f0b7d230a90c82c6fee7adcb46a213d2582b6a7b
* Export of internal Abseil changesGravatar Abseil Team2022-01-27
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | -- 7fbe730c56c0890f27df47f9ad4f0cfa600c6ad9 by Derek Mauro <dmauro@google.com>: Internal change PiperOrigin-RevId: 424639048 -- 1825fcf704e45e881cdd1d2fe3eb2226f523f3cd by Derek Mauro <dmauro@google.com>: Disable tests Table.EnsureNonQuadraticTopNXorSeedByProbeSeqLength and Table.EnsureNonQuadraticTopNLinearTransformByProbeSeqLength again as they are (still) flaky PiperOrigin-RevId: 424616745 -- e624119171d9bceec2f6df023b220a6642070cfb by Abseil Team <absl-team@google.com>: Switch from *_TEST_CASE_P to *_TEST_SUITE_P gtest macros. PiperOrigin-RevId: 424404790 -- a110698c10554fb1f640412db8cd7c5a38b7b8e8 by Abseil Team <absl-team@google.com>: Remove extraneous newline in documentation. PiperOrigin-RevId: 424328502 GitOrigin-RevId: 7fbe730c56c0890f27df47f9ad4f0cfa600c6ad9 Change-Id: I56fd8c7cecf65fe37cb4cf2dde70842867d637d7
* Export of internal Abseil changesGravatar Abseil Team2022-01-19
| | | | | | | | | | | | | | | -- 487c7a754a3b93bc0f9de14bdced48007a96ae55 by Greg Falcon <gfalcon@google.com>: Add support for absl::Hash to hash unordered containers. These can now be hashed directly, as well as combined in AbslHashValue implementations. This also adds a new method, `H::combine_unordered()`, to the public AbslHashValue hash state API. This allows users to implement hash specializations for their own unordered collection types. A traits class, `H::is_hashable<T>`, is also added to the hash state API. H::is_hashable<T>::value reflects whether type T is considered hashable by the AbslHashValue framework. This allows users to properly SFINAE templated versions of AbslHashValue. (The AbslHashValue implementation added to raw_hash_set shows an example of its use.) PiperOrigin-RevId: 422856706 GitOrigin-RevId: 487c7a754a3b93bc0f9de14bdced48007a96ae55 Change-Id: Id31fd4ccba282f8c9ae6fcee6ae0ad0f7879f456
* Export of internal Abseil changesGravatar Abseil Team2021-11-17
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | -- 2130ba98c8359b08d97fb16d84dfd05687005dcf by Abseil Team <absl-team@google.com>: Tweaking the documentation of c_all_of to state the effect more directly. PiperOrigin-RevId: 410557900 -- 4732289bf4b56123fed113e36be4710b55c6a6c7 by Greg Falcon <gfalcon@google.com>: Improve the quality of absl::Hash<std::vector<bool>>. This previously dispatched to std::hash<vector<bool>>, which suffers from trivial collisions on many platforms. (They often hash the internal words but no size info, so that, e.g., {1, 1} and {1, 1, 0} collide.) Also extended the unit test to exercise this. PiperOrigin-RevId: 410329943 -- 1c5f3934230a7669f74c96b305251786a265e235 by Greg Falcon <gfalcon@google.com>: Add broader testing of absl hash contracts in the hash unit test. In particular, test that the hash erasure mechanism works. PiperOrigin-RevId: 410312738 -- 5e1923f527ed3d02f6752a5b38d5e1c17a4a146f by Derek Mauro <dmauro@google.com>: Internal change PiperOrigin-RevId: 410290663 -- 8c74bc962b3b98a5908017c345efc592393048ea by Martijn Vels <mvels@google.com>: Add Cord::CreateFlat() function PiperOrigin-RevId: 410260776 -- bd0de4e94c85620d3b8dd60fae367b730fc4cb34 by Evan Brown <ezb@google.com>: Rename node_hash_policy to node_slot_policy. Motivation: we can potentially reuse this code for node_btree_*. PiperOrigin-RevId: 410082271 GitOrigin-RevId: 2130ba98c8359b08d97fb16d84dfd05687005dcf Change-Id: Ie052084cf992dee250d8b2f388d39c4de0dcff40
* Remove bazelbuild/rules_cc dependency (#1038)Gravatar Vertexwahn2021-10-14
|
* Fix hashing on big endian platforms (#1028)Gravatar Milad Fa2021-10-06
| | | | | | | | | | | Avoid using libstdc++'s implementation of std::hash<std::bitset> and std::hash<std::vector> on big endian platforms in the implementation of absl::Hash. This is a workaround for a buggy implementation that results in many collisions. https://gcc.gnu.org/bugzilla/show_bug.cgi?id=102531 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=98731