core.internal.hash.bytesHash: in 64-bit builds use a 64-bit-oriented algorithm
Motivation: doesn't discard high 32 bits of seed; produces 64 bits of output; and is a bit faster.
Thanks for your pull request, @n8sh!
Bugzilla references
| Auto-close | Bugzilla | Severity | Description |
|---|---|---|---|
| ✓ | 21006 | enhancement | core.internal.hash.bytesHash: in 64-bit builds use a 64-bit-oriented algorithm |
Testing this PR locally
If you don't have a local development environment setup, you can use Digger to test this PR:
dub run digger -- build "master + druntime#3148"
Test runnable/testaa2.d failed:
expected:
----
foo()
foo() 2
foo() 3
foo() 4
c["foo"] = 3
c["bar"] = 4
Success
----
actual:
----
foo()
foo() 2
foo() 3
foo() 4
c["bar"] = 4
c["foo"] = 3
Success
A DMD test is failing because it depends on a specific AA traversal order. I am inclined to consider that erroneous based on https://dlang.org/spec/hash-map.html:
The built-in associative arrays do not preserve the order of the keys inserted into the array. In particular, in a foreach loop the order in which the elements are iterated is typically unspecified.
Indeed. This test should be fixed.
Please add a reference for this hash algorithm in a comment