about summary refs log tree commit diff
path: root/compiler/rustc_data_structures/src/sip128.rs
AgeCommit message (Collapse)AuthorLines
2024-07-11Use uplifted `rustc-stable-hash` crate in `rustc_data_structures`Urgau-505/+0
2024-07-01Optimize SipHash by reordering compress instructionsmat-5/+6
2024-06-24Replace `MaybeUninit::uninit_array()` with array repeat expression.Kevin Reid-1/+1
This is possible now that inline const blocks are stable; the idea was even mentioned as an alternative when `uninit_array()` was added: <https://github.com/rust-lang/rust/pull/65580#issuecomment-544200681> > if it’s stabilized soon enough maybe it’s not worth having a > standard library method that will be replaceable with > `let buffer = [MaybeUninit::<T>::uninit(); $N];` Const array repetition and inline const blocks are now stable (in the next release), so that circumstance has come to pass, and we no longer have reason to want `uninit_array()` other than convenience. Therefore, let’s evaluate the inconvenience by not using `uninit_array()` in the standard library, before potentially deleting it entirely.
2024-04-13Add add/sub methods that only panic with debug assertions to rustcNilstrieb-17/+21
This mitigates the perf impact of enabling overflow checks on rustc. The change to use overflow checks will be done in a later PR.
2023-04-19`deny(unsafe_op_in_unsafe_fn)` in `rustc_data_structures`Maybe Waffle-95/+101
2023-04-05Use SipHash-1-3 instead of SipHash-2-4 for StableHasherThom Chiovoloni-11/+9
2022-06-04Fix stacked borrows invalidation in rustc_data_structures sip128Nilstrieb-1/+2
It creates the src pointer first, which is then invalidated by a unique borrow of the destination pointer. Swap the borrows around to fix this. Found with miri.
2022-05-06Add a dedicated length-prefixing method to `Hasher`Scott McMurray-0/+8
This accomplishes two main goals: - Make it clear who is responsible for prefix-freedom, including how they should do it - Make it feasible for a `Hasher` that *doesn't* care about Hash-DoS resistance to get better performance by not hashing lengths This does not change rustc-hash, since that's in an external crate, but that could potentially use it in future.
2022-02-05Use const generics in SipHasher128's short_writeJakub Beránek-32/+29
2022-01-24Revert "Do not hash leading zero bytes of i64 numbers in Sip128 hasher"Jakub Beránek-16/+2
2022-01-04Do not hash zero bytes of i64 and u32 in Sip128 hasherJakub Beránek-2/+16
2020-10-11SipHasher128: improve constant names and add more commentsTyson Nottingham-36/+66
2020-10-05SipHasher128: use specific struct layoutTyson Nottingham-0/+6
2020-10-05SipHasher128: use more named constants, update commentsTyson Nottingham-50/+54
2020-10-03perf: buffer SipHasher128Tyson Nottingham-196/+303
2020-09-30Stable hashing: add comments and tests concerning platform-independenceTyson Nottingham-6/+19
SipHasher128 implements short_write in an endian-independent way, yet its write_xxx Hasher trait methods undo this endian-independence by byte swapping the integer inputs on big-endian hardware. StableHasher then adds endian-independence back by also byte-swapping on big-endian hardware prior to invoking SipHasher128. This double swap may have the appearance of being a no-op, but is in fact by design. In particular, we really do want SipHasher128 to be platform-dependent, in order to be consistent with the libstd SipHasher. Try to clarify this intent. Also, add and update a couple of unit tests.
2020-08-30mv compiler to compiler/mark-0/+330