This is a live mirror of the Perl 5 development currently hosted at
https://github.com/perl/perl5
https://perl5.git.perl.org
/
perl5.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
a480973
)
A better hash for PTR_TABLE_HASH (?)
author
Nicholas Clark
<nick@ccl4.org>
Fri, 9 Dec 2005 23:09:42 +0000
(23:09 +0000)
committer
Nicholas Clark
<nick@ccl4.org>
Fri, 9 Dec 2005 23:09:42 +0000
(23:09 +0000)
p4raw-id: //depot/perl@26315
sv.c
patch
|
blob
|
blame
|
history
diff --git
a/sv.c
b/sv.c
index
9ed37cb
..
30b499d
100644
(file)
--- a/
sv.c
+++ b/
sv.c
@@
-9031,11
+9031,8
@@
Perl_ptr_table_new(pTHX)
return tbl;
}
-#if (PTRSIZE == 8)
-# define PTR_TABLE_HASH(ptr) (PTR2UV(ptr) >> 3)
-#else
-# define PTR_TABLE_HASH(ptr) (PTR2UV(ptr) >> 2)
-#endif
+#define PTR_TABLE_HASH(ptr) \
+ ((PTR2UV(ptr) >> 3) ^ (PTR2UV(ptr) >> (3 + 7)) ^ (PTR2UV(ptr) >> (3 + 17)))
/*
we use the PTE_SVSLOT 'reservation' made above, both here (in the