Skip to content

Commit

Permalink
chore(*): adjust non-miri-friendly assertion condition
Browse files Browse the repository at this point in the history
  • Loading branch information
wvwwvwwv committed Oct 11, 2024
1 parent 626237a commit c0c9472
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 5 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@

## Version 2

2.2.1

* Fix a minor Miri specific assertion failure.

2.2.0

* Add `Comparable` and `Equivalent` traits: [#162](https://github.com/wvwwvwwv/scalable-concurrent-containers/issues/162) by [qthree](https://github.com/qthree).
Expand Down
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
name = "scc"
description = "High performance containers and utilities for concurrent and asynchronous programming"
documentation = "https://docs.rs/scc"
version = "2.2.0"
version = "2.2.1"
authors = ["wvwwvwwv <[email protected]>"]
edition = "2021"
rust-version = "1.65.0"
Expand Down
2 changes: 1 addition & 1 deletion src/hash_table/bucket_array.rs
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ impl<K, V, L: LruList, const TYPE: char> BucketArray<K, V, L, TYPE> {
bucket_array_ptr_offset + bucket_size * array_len <= bucket_array_allocation_size,
);
assert_eq!(
(bucket_array_ptr as usize + bucket_array_ptr_offset) % bucket_size,
(bucket_array_ptr as usize + bucket_array_ptr_offset) % bucket_size.next_power_of_two(),
0
);

Expand Down
6 changes: 3 additions & 3 deletions src/tree_index/node.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ use crate::wait_queue::DeriveAsyncWait;
use crate::Comparable;
use std::fmt::{self, Debug};
use std::ops::RangeBounds;
use std::sync::atomic::Ordering::{AcqRel, Acquire, Relaxed, Release};
use std::sync::atomic::Ordering::{AcqRel, Acquire, Relaxed};

/// [`Node`] is either [`Self::Internal`] or [`Self::Leaf`].
pub enum Node<K, V> {
Expand Down Expand Up @@ -224,8 +224,8 @@ where
match root.compare_exchange(
root_ptr,
(Some(new_root), Tag::None),
Release,
Relaxed,
AcqRel,
Acquire,
guard,
) {
Ok((old_root, new_root_ptr)) => {
Expand Down

0 comments on commit c0c9472

Please sign in to comment.