Skip to content

hashWord ignores the lower 8 bits of the word it hashes

hashWord contains this code

 83     /* Strip the boring zero bits */                                            
 84     key >>= sizeof(StgWord);                                                    
 85                                     

which zeros the lower 8 bits of a word.

This code was changed (almost certainly incorrectly) in f80c4a66

It used to be

key /= sizeof(StgWord);

Which zeros the lower 3 bits of a word, much less aggressive.

The effect is that if you have anything which is smaller than 2^8 to hashWord it ends up in the same bucket.

cc @fendor @bgamari

Edited by Hannes Siebenhandl
To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information