Export of internal Abseil changes.
-- b7d4f72ebb8a052cb2c6dfbfb628200eb64585c5 by CJ Johnson <johnsoncj@google.com>: `Hash` -> `H` for AbslHashValue in InlinedVector PiperOrigin-RevId: 229765535 -- ecceb8dc7eb9fe576dd0b8f0e95b5d3c3e92795d by Abseil Team <absl-team@google.com>: fix ubsan error in Mutex on arm32 PiperOrigin-RevId: 229744897 GitOrigin-RevId: b7d4f72ebb8a052cb2c6dfbfb628200eb64585c5 Change-Id: Ic0fd2252f9838d5fceffc808d05a09a8bc872efc
This commit is contained in:
parent
5e6a78131f
commit
efccc50260
2 changed files with 8 additions and 8 deletions
|
@ -808,8 +808,8 @@ class InlinedVector {
|
||||||
}
|
}
|
||||||
|
|
||||||
private:
|
private:
|
||||||
template <typename Hash, typename TheT, size_t TheN, typename TheA>
|
template <typename H, typename TheT, size_t TheN, typename TheA>
|
||||||
friend Hash AbslHashValue(Hash, const InlinedVector<TheT, TheN, TheA>& vec);
|
friend H AbslHashValue(H, const InlinedVector<TheT, TheN, TheA>& vector);
|
||||||
|
|
||||||
// Holds whether the vector is allocated or not in the lowest bit and the size
|
// Holds whether the vector is allocated or not in the lowest bit and the size
|
||||||
// in the high bits:
|
// in the high bits:
|
||||||
|
@ -1358,11 +1358,11 @@ bool operator>=(const InlinedVector<T, N, A>& a,
|
||||||
//
|
//
|
||||||
// Provides `absl::Hash` support for inlined vectors. You do not normally call
|
// Provides `absl::Hash` support for inlined vectors. You do not normally call
|
||||||
// this function directly.
|
// this function directly.
|
||||||
template <typename Hash, typename TheT, size_t TheN, typename TheA>
|
template <typename H, typename TheT, size_t TheN, typename TheA>
|
||||||
Hash AbslHashValue(Hash hash, const InlinedVector<TheT, TheN, TheA>& vec) {
|
H AbslHashValue(H hash, const InlinedVector<TheT, TheN, TheA>& vector) {
|
||||||
auto p = vec.data();
|
auto p = vector.data();
|
||||||
auto n = vec.size();
|
auto n = vector.size();
|
||||||
return Hash::combine(Hash::combine_contiguous(std::move(hash), p, n), n);
|
return H::combine(H::combine_contiguous(std::move(hash), p, n), n);
|
||||||
}
|
}
|
||||||
|
|
||||||
// -----------------------------------------------------------------------------
|
// -----------------------------------------------------------------------------
|
||||||
|
|
|
@ -1841,7 +1841,7 @@ static void CheckForMutexCorruption(intptr_t v, const char* label) {
|
||||||
// Test for either of two situations that should not occur in v:
|
// Test for either of two situations that should not occur in v:
|
||||||
// kMuWriter and kMuReader
|
// kMuWriter and kMuReader
|
||||||
// kMuWrWait and !kMuWait
|
// kMuWrWait and !kMuWait
|
||||||
const intptr_t w = v ^ kMuWait;
|
const uintptr_t w = v ^ kMuWait;
|
||||||
// By flipping that bit, we can now test for:
|
// By flipping that bit, we can now test for:
|
||||||
// kMuWriter and kMuReader in w
|
// kMuWriter and kMuReader in w
|
||||||
// kMuWrWait and kMuWait in w
|
// kMuWrWait and kMuWait in w
|
||||||
|
|
Loading…
Reference in a new issue