mirror of
https://github.com/greg7mdp/parallel-hashmap.git
synced 2026-08-30 17:10:40 +08:00
The default hash does not like using pointers as keys. #4
This commit is contained in:
Vendored
+2
-2
@@ -99,7 +99,7 @@ struct Hash<T *>
|
||||
{
|
||||
inline size_t operator()(const T *val) const noexcept
|
||||
{
|
||||
return phmap_mix_64(static_cast<const uintptr_t>(val));
|
||||
return phmap_mix_64((const uintptr_t)val);
|
||||
}
|
||||
};
|
||||
|
||||
@@ -2547,7 +2547,7 @@ protected:
|
||||
bool operator==(const Inner& o) const
|
||||
{
|
||||
MutexLock_ m1(const_cast<Inner *>(this));
|
||||
MutexLock_ m2(const_cast<Inner *>(&o));
|
||||
MutexLock_ m2(const_cast<Inner *>(&o)); // deadlock - use std::lock
|
||||
return set_ == o.set_;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user