Closed Bug 1376563 Opened 7 years ago Closed 7 years ago

nsPtrHashKey::HashKey() in 64-bit builds throws away two bits that could be used in the hash generation, leading to unnecessary collisions

Categories

(Core :: XPCOM, defect)

defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla56
Tracking Status
firefox56 --- fixed

People

(Reporter: ehsan.akhgari, Assigned: ehsan.akhgari)

References

(Blocks 1 open bug)

Details

Attachments

(1 file)

Note that the function first does the cast down to 32 bits and then shifts. :-(
PLDHashTable::HashVoidPtrKeyStub() has the same issue.
Attachment #8881507 - Flags: review?(nfroyd) → review+
Pushed by eakhgari@mozilla.com:
https://hg.mozilla.org/integration/mozilla-inbound/rev/c8aec01b0243
Improve the hash key generation for hashtables containing pointers on 64-bit platforms by using 2 more bits of the original pointer in calculating the hash key; r=froydnj
https://hg.mozilla.org/mozilla-central/rev/c8aec01b0243
Status: NEW → RESOLVED
Closed: 7 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla56
Assignee: nobody → ehsan
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: