Skip to content

Use a better hash table magic constant - #1403

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

bnoordhuis merged 1 commit into
quickjs-ng:masterfrom
bnoordhuis:better-hash-magic

Conversation

@bnoordhuis

Copy link
Copy Markdown
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
mochaaP pushed a commit to mcha-forks/quickjs that referenced this pull request May 20, 2026
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.

(cherry picked from commit e2b100e)
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