summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNicholas Clark <nick@ccl4.org>2006-01-16 12:51:43 +0000
committerNicholas Clark <nick@ccl4.org>2006-01-16 12:51:43 +0000
commit0126ccc7b0881ebd6ffb9dc9eaca0152046eff2e (patch)
tree29598914cdd7c61f5bf6a336ee1c2ea7206c2ebc
parentbccaac156045cedac877d0f378dcfb2acc3fe489 (diff)
downloadperl-0126ccc7b0881ebd6ffb9dc9eaca0152046eff2e.tar.gz
Integrate:
[ 26315] A better hash for PTR_TABLE_HASH (?) p4raw-link: @26315 on //depot/perl: 7119fd33ffc5ef947b59b6096cf5249ee05d4397 p4raw-id: //depot/maint-5.8/perl@26860 p4raw-integrated: from //depot/perl@26315 'merge in' sv.c (@26313..)
-rw-r--r--sv.c7
1 files changed, 2 insertions, 5 deletions
diff --git a/sv.c b/sv.c
index 57f35a1a60..281634d000 100644
--- a/sv.c
+++ b/sv.c
@@ -9812,11 +9812,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)))