diff options
author | Nicholas Clark <nick@ccl4.org> | 2005-12-09 23:09:42 +0000 |
---|---|---|
committer | Nicholas Clark <nick@ccl4.org> | 2005-12-09 23:09:42 +0000 |
commit | 7119fd33ffc5ef947b59b6096cf5249ee05d4397 (patch) | |
tree | 5122595e2b5bb7257373f10189361211f8158c6e /sv.c | |
parent | a480973c1ced848c2939979a8dcc3d6f2eb49d79 (diff) | |
download | perl-7119fd33ffc5ef947b59b6096cf5249ee05d4397.tar.gz |
A better hash for PTR_TABLE_HASH (?)
p4raw-id: //depot/perl@26315
Diffstat (limited to 'sv.c')
-rw-r--r-- | sv.c | 7 |
1 files changed, 2 insertions, 5 deletions
@@ -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 |