summaryrefslogtreecommitdiff
path: root/sv.c
diff options
context:
space:
mode:
authorNicholas Clark <nick@ccl4.org>2005-12-09 23:09:42 +0000
committerNicholas Clark <nick@ccl4.org>2005-12-09 23:09:42 +0000
commit7119fd33ffc5ef947b59b6096cf5249ee05d4397 (patch)
tree5122595e2b5bb7257373f10189361211f8158c6e /sv.c
parenta480973c1ced848c2939979a8dcc3d6f2eb49d79 (diff)
downloadperl-7119fd33ffc5ef947b59b6096cf5249ee05d4397.tar.gz
A better hash for PTR_TABLE_HASH (?)
p4raw-id: //depot/perl@26315
Diffstat (limited to 'sv.c')
-rw-r--r--sv.c7
1 files changed, 2 insertions, 5 deletions
diff --git a/sv.c b/sv.c
index 9ed37cb03b..30b499ddf3 100644
--- 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