This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author mark.dickinson
Recipients Rhamphoryncus, jcea, mark.dickinson, pitrou, rhettinger
Date 2009-02-11.10:53:22
SpamBayes Score 1.06581e-14
Marked as misclassified No
Message-id <>
[Adam Olsen]
> The alignment requirements (long double) make it impossible to have
> anything in those bits.

Not necessarily, since not all pointers passed to _Py_HashPointer come
from a PyObject_Malloc.  _Py_HashPointer is used for function pointers
as well.  For example, on 64-bit linux I get:

Python 2.7a0 (trunk:69516, Feb 11 2009, 10:43:51)
[GCC 4.2.1 (SUSE Linux)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> from hashlib import sha224
>>> hash(sha224)
>>> hash(sha224) % 16

> for that you'd need a dictionary with at least 2 billion entries
> on 32bit,

<nitpick> If I recall correctly, the higher bits of the hash value also
get used in collision resolution: they're mixed in to the algorithm
that's used to produce the probing sequence when looking for an empty
slot.  So the dictionary wouldn't necessarily have to be quite that
large for the top bits to come into play. </nitpick>

But I agree that mixing the bottom bits back in (via rotate, or xor, or
whatever) doesn't seem likely to help.
Date User Action Args
2009-02-11 10:53:26mark.dickinsonsetrecipients: + mark.dickinson, rhettinger, jcea, Rhamphoryncus, pitrou
2009-02-11 10:53:25mark.dickinsonsetmessageid: <>
2009-02-11 10:53:24mark.dickinsonlinkissue5186 messages
2009-02-11 10:53:22mark.dickinsoncreate