< prev index next >
src/hotspot/share/utilities/globalDefinitions.hpp
Print this page
*** 1259,1264 ****
--- 1259,1277 ----
// processing utilities.
typedef const char* ccstr;
typedef const char* ccstrlist; // represents string arguments which accumulate
+ //----------------------------------------------------------------------------------------------------
+ // Default hash/equals functions used by ResourceHashtable and KVHashtable
+
+ template<typename K> unsigned primitive_hash(const K& k) {
+ unsigned hash = (unsigned)((uintptr_t)k);
+ return hash ^ (hash >> 3); // just in case we're dealing with aligned ptrs
+ }
+
+ template<typename K> bool primitive_equals(const K& k0, const K& k1) {
+ return k0 == k1;
+ }
+
+
#endif // SHARE_VM_UTILITIES_GLOBALDEFINITIONS_HPP
< prev index next >