projects
/
mono.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
4f1a64a
)
[runtime] Use better hashing for refobject_hash
author
Vlad Brezae
<brezaevlad@gmail.com>
Fri, 17 Feb 2017 00:25:44 +0000
(
02:25
+0200)
committer
Vlad Brezae
<brezaevlad@gmail.com>
Mon, 20 Feb 2017 12:24:25 +0000
(14:24 +0200)
mono/metadata/reflection.c
patch
|
blob
|
history
diff --git
a/mono/metadata/reflection.c
b/mono/metadata/reflection.c
index 1ddb08757a35cf6ad594485318d1edbe172b5bb9..bf97132d85e790303aeae59ca66df1ab97c34138 100644
(file)
--- a/
mono/metadata/reflection.c
+++ b/
mono/metadata/reflection.c
@@
-165,7
+165,10
@@
reflected_equal (gconstpointer a, gconstpointer b)
guint
reflected_hash (gconstpointer a) {
const ReflectedEntry *ea = (const ReflectedEntry *)a;
- return mono_aligned_addr_hash (ea->item);
+ /* Combine hashes for item and refclass. Identical to boost's hash_combine */
+ guint seed = mono_aligned_addr_hash (ea->item) + 0x9e3779b9;
+ seed ^= mono_aligned_addr_hash (ea->refclass) + 0x9e3779b9 + (seed << 6) + (seed >> 2);
+ return seed;
}