Skip to content

Use a better hash table magic constant#1403

Merged
bnoordhuis merged 1 commit intoquickjs-ng:masterfrom
bnoordhuis:better-hash-magic
Mar 15, 2026
Merged

Use a better hash table magic constant#1403
bnoordhuis merged 1 commit intoquickjs-ng:masterfrom
bnoordhuis:better-hash-magic

Conversation

@bnoordhuis
Copy link
Contributor

The Linux kernel moved away from 0x9e370001 in 2016 because it doesn't mix bits as well as it should. Replace it with a magic constant based on the golden ratio, the same one modern kernels use.

Remove the perl hash implementation that was used for tracking local variables. The generic hash function now works as well as perl hash.

The Linux kernel moved away from 0x9e370001 in 2016 because it doesn't
mix bits as well as it should. Replace it with a magic constant based
on the golden ratio, the same one modern kernels use.

Remove the perl hash implementation that was used for tracking local
variables. The generic hash function now works as well as perl hash.
@bnoordhuis bnoordhuis merged commit e2b100e into quickjs-ng:master Mar 15, 2026
123 checks passed
@bnoordhuis bnoordhuis deleted the better-hash-magic branch March 15, 2026 20:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants