Skip to content

Commit

Permalink
Avoid warnings under miri
Browse files Browse the repository at this point in the history
  • Loading branch information
jonhoo committed May 6, 2020
1 parent e6ad4f8 commit d944731
Showing 1 changed file with 5 additions and 6 deletions.
11 changes: 5 additions & 6 deletions src/map.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,7 @@ use std::error::Error;
use std::fmt::{self, Debug, Display, Formatter};
use std::hash::{BuildHasher, Hash, Hasher};
use std::iter::FromIterator;
use std::sync::{
atomic::{AtomicIsize, AtomicUsize, Ordering},
Once,
};
use std::sync::atomic::{AtomicIsize, Ordering};

const ISIZE_BITS: usize = core::mem::size_of::<isize>() * 8;

Expand Down Expand Up @@ -62,8 +59,10 @@ const MAX_RESIZERS: isize = (1 << (ISIZE_BITS - RESIZE_STAMP_BITS)) - 1;
/// The bit shift for recording size stamp in `size_ctl`.
const RESIZE_STAMP_SHIFT: usize = ISIZE_BITS - RESIZE_STAMP_BITS;

static NCPU_INITIALIZER: Once = Once::new();
static NCPU: AtomicUsize = AtomicUsize::new(0);
#[cfg(not(miri))]
static NCPU_INITIALIZER: std::sync::Once = std::sync::Once::new();
#[cfg(not(miri))]
static NCPU: std::sync::atomic::AtomicUsize = std::sync::atomic::AtomicUsize::new(0);

macro_rules! load_factor {
($n: expr) => {
Expand Down

0 comments on commit d944731

Please sign in to comment.