gh-111389: Add PyHASH_MULTIPLIER constant (#119214)

This commit is contained in:
Victor Stinner 2024-05-21 19:51:51 +02:00 committed by GitHub
parent 87939bd579
commit f6da790122
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
7 changed files with 16 additions and 7 deletions

View file

@ -1496,7 +1496,7 @@ address_to_hash(void *ptr) {
uintptr_t addr = (uintptr_t)ptr;
for (int i = 0; i < SIZEOF_VOID_P; i++) {
uhash ^= addr & 255;
uhash *= (uint64_t)_PyHASH_MULTIPLIER;
uhash *= (uint64_t)PyHASH_MULTIPLIER;
addr >>= 8;
}
return uhash;