]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
common/lockdep: drop hash<pthread_t> specialization 20574/head
authorKefu Chai <kchai@redhat.com>
Sat, 24 Feb 2018 03:31:47 +0000 (11:31 +0800)
committerKefu Chai <kchai@redhat.com>
Sat, 24 Feb 2018 03:34:04 +0000 (11:34 +0800)
quote from http://en.cppreference.com/w/cpp/utility/hash:

> Each standard library header that declares the template std::hash
> provides enabled specializations of std::hash for std::nullptr
> and all cv-unqualified arithmetic types (including any extended
> integer types), all enumeration types, and all pointer types.

since we've switched to C++17. this full specialization is not necessary
anymore.

Signed-off-by: Kefu Chai <kchai@redhat.com>
src/common/lockdep.cc

index 9b00dcd6e3a09fc52c4bc13f5ee5377d4f4cb520..cf0aba6dd4f50e6eb13d48dd4c00bb7de5f80536 100644 (file)
 #include "common/dout.h"
 #include "common/valgrind.h"
 
-#if defined(__FreeBSD__) && defined(__LP64__)  // On FreeBSD pthread_t is a pointer.
-namespace std {
-  template<>
-    struct hash<pthread_t>
-    {
-      size_t
-      operator()(pthread_t __x) const
-      { return (uintptr_t)__x; }
-    };
-} // namespace std
-#endif
-
 /******* Constants **********/
 #define lockdep_dout(v) lsubdout(g_lockdep_ceph_ctx, lockdep, v)
 #define MAX_LOCKS  4096   // increase me as needed