Skip to content

Commit

Permalink
Bump up versions
Browse files Browse the repository at this point in the history
  • Loading branch information
al8n committed Apr 27, 2024
1 parent 1e5603f commit 9f20506
Show file tree
Hide file tree
Showing 6 changed files with 11 additions and 28 deletions.
4 changes: 2 additions & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "stretto"
version = "0.8.3"
version = "0.8.4"
authors = ["Al Liu <[email protected]>"]
description = "Stretto is a high performance thread-safe memory-bound Rust cache."
homepage = "https://github.com/al8n/stretto"
Expand Down Expand Up @@ -52,7 +52,7 @@ rand = "0.8"
serde = { version = "1", optional = true, features = ["derive"] }
serde_json = { version = "1", optional = true }
seahash = "4.1"
wg = "0.6"
wg = "0.9"
thiserror = "1"
tracing = "0.1"
xxhash-rust = { version = "0.8", features = ["xxh64"] }
Expand Down
4 changes: 3 additions & 1 deletion src/cache.rs
Original file line number Diff line number Diff line change
Expand Up @@ -739,7 +739,9 @@ macro_rules! impl_cache_cleaner {
expiration,
)),
$item::Delete { .. } | $item::Update { .. } => {}
$item::Wait(wg) => wg.done(),
$item::Wait(wg) => {
let _ = wg.done();
}
}
}
}
Expand Down
21 changes: 4 additions & 17 deletions src/cache/test.rs
Original file line number Diff line number Diff line change
Expand Up @@ -112,19 +112,13 @@ impl CacheCallback for TestCallbackDropUpdates {
mod sync_test {
use super::*;
use crate::cache::sync::Item;
use crate::cache::test::{KHTest, TestCallback, TestCallbackDropUpdates, TestCoster};
use crate::{
Cache, CacheBuilder, CacheCallback, Coster, DefaultCacheCallback, DefaultCoster,
DefaultKeyBuilder, DefaultUpdateValidator, KeyBuilder, TransparentKeyBuilder,
UpdateValidator,
Cache, CacheBuilder, DefaultCacheCallback, DefaultCoster, DefaultKeyBuilder,
DefaultUpdateValidator, TransparentKeyBuilder, UpdateValidator,
};
use crossbeam_channel::{bounded, select};
use parking_lot::Mutex;
use std::collections::hash_map::RandomState;
use std::collections::HashSet;
use std::hash::Hash;
use std::sync::atomic::{AtomicU64, Ordering};
use std::sync::Arc;
use std::thread::{sleep, spawn};
use std::time::Duration;

Expand Down Expand Up @@ -739,18 +733,11 @@ mod async_test {
use super::*;
use crate::cache::r#async::Item;
use crate::{
AsyncCache, AsyncCacheBuilder, CacheCallback, Coster, DefaultCacheCallback, DefaultCoster,
DefaultKeyBuilder, DefaultUpdateValidator, KeyBuilder, TransparentKeyBuilder,
UpdateValidator,
AsyncCache, AsyncCacheBuilder, DefaultCacheCallback, DefaultCoster, DefaultKeyBuilder,
DefaultUpdateValidator, TransparentKeyBuilder, UpdateValidator,
};
use parking_lot::Mutex;
use rand::rngs::OsRng;
use rand::Rng;
use std::collections::hash_map::RandomState;
use std::collections::HashSet;
use std::hash::Hash;
use std::sync::atomic::{AtomicU64, Ordering};
use std::sync::Arc;
use std::time::Duration;
use tokio::sync::mpsc::channel;
use tokio::task::spawn;
Expand Down
8 changes: 2 additions & 6 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -345,9 +345,7 @@ impl<K: Hash + Eq> KeyBuilder for DefaultKeyBuilder<K> {
Self::Key: core::borrow::Borrow<Q>,
Q: core::hash::Hash + Eq + ?Sized,
{
let mut s = self.sea.build_hasher();
key.hash(&mut s);
s.finish()
self.sea.hash_one(key)
}

#[inline]
Expand All @@ -356,9 +354,7 @@ impl<K: Hash + Eq> KeyBuilder for DefaultKeyBuilder<K> {
Self::Key: core::borrow::Borrow<Q>,
Q: core::hash::Hash + Eq + ?Sized,
{
let mut x = self.xx.build_hasher();
key.hash(&mut x);
x.finish()
self.xx.hash_one(key)
}
}

Expand Down
1 change: 0 additions & 1 deletion src/store.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ use crate::{CacheError, DefaultUpdateValidator, Item as CrateItem, UpdateValidat
use parking_lot::RwLock;
use std::collections::hash_map::RandomState;
use std::collections::HashMap;
use std::convert::TryInto;
use std::fmt::{Debug, Formatter};
use std::hash::BuildHasher;
use std::mem;
Expand Down
1 change: 0 additions & 1 deletion src/utils.rs
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ use parking_lot::{RwLockReadGuard, RwLockWriteGuard};
use std::cell::UnsafeCell;
use std::collections::hash_map::RandomState;
use std::collections::HashMap;
use std::convert::TryInto;
use std::fmt::{Debug, Display, Formatter};
use std::hash::BuildHasher;
use std::time::Duration;
Expand Down

0 comments on commit 9f20506

Please sign in to comment.