Skip to content

Commit

Permalink
0.8.14: Remove overly eager prefetch
Browse files Browse the repository at this point in the history
  • Loading branch information
DoumanAsh committed Dec 23, 2024
1 parent b76c4c0 commit c359aee
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 3 deletions.
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "xxhash-rust"
version = "0.8.13"
version = "0.8.14"
authors = ["Douman <douman@gmx.se>"]
edition = "2018"
description = "Implementation of xxhash"
Expand Down
2 changes: 1 addition & 1 deletion src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@
#![no_std]
#![warn(missing_docs)]
#![cfg_attr(feature = "cargo-clippy", allow(clippy::style))]
#![allow(clippy::style)]

#[cfg(feature = "std")]
extern crate std;
Expand Down
12 changes: 11 additions & 1 deletion src/xxh3.rs
Original file line number Diff line number Diff line change
Expand Up @@ -513,7 +513,17 @@ fn hash_long_internal_loop(acc: &mut Acc, input: &[u8], secret: &[u8]) {

let nb_stripes = ((input.len() - 1) - (block_len * nb_blocks)) / STRIPE_LEN;
debug_assert!(nb_stripes <= (secret.len() / SECRET_CONSUME_RATE));
accumulate_loop(acc, slice_offset_ptr!(input, nb_blocks * block_len), secret.as_ptr(), nb_stripes);
//accumulate_loop(acc, slice_offset_ptr!(input, nb_blocks * block_len), secret.as_ptr(), nb_stripes);
for idx in 0..nb_stripes {
unsafe {
let input = slice_offset_ptr!(input, nb_blocks * block_len + idx * STRIPE_LEN);

accumulate_512(acc,
&*(input as *const _),
&*(secret.as_ptr().add(idx * SECRET_CONSUME_RATE) as *const _)
);
}
}

//last stripe
accumulate_512(acc, get_aligned_chunk_ref(input, input.len() - STRIPE_LEN), get_aligned_chunk_ref(secret, secret.len() - STRIPE_LEN - SECRET_LASTACC_START));
Expand Down

0 comments on commit c359aee

Please sign in to comment.