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.0658141e-14
Marked as misclassified No
Message-id <1234349605.48.0.164667885737.issue5186@psf.upfronthosting.co.za>
In-reply-to
Content
[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)
47100514454970
>>> hash(sha224) % 16
10

> 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.
History
Date User Action Args
2009-02-11 10:53:26mark.dickinsonsetrecipients: + mark.dickinson, rhettinger, jcea, Rhamphoryncus, pitrou
2009-02-11 10:53:25mark.dickinsonsetmessageid: <1234349605.48.0.164667885737.issue5186@psf.upfronthosting.co.za>
2009-02-11 10:53:24mark.dickinsonlinkissue5186 messages
2009-02-11 10:53:22mark.dickinsoncreate