mirror of
https://github.com/salsa-rs/salsa.git
synced 2025-01-12 16:35:21 +00:00
Use AtomicUsize instead of AtomicU64
This commit is contained in:
parent
1c349d4229
commit
69b9dff557
3 changed files with 5 additions and 7 deletions
|
@ -1,7 +1,6 @@
|
|||
#![deny(rust_2018_idioms)]
|
||||
#![feature(in_band_lifetimes)]
|
||||
#![feature(nll)]
|
||||
#![feature(integer_atomics)]
|
||||
#![allow(dead_code)]
|
||||
#![allow(unused_imports)]
|
||||
|
||||
|
|
|
@ -6,7 +6,7 @@ use rustc_hash::FxHasher;
|
|||
use std::cell::RefCell;
|
||||
use std::fmt::Write;
|
||||
use std::hash::BuildHasherDefault;
|
||||
use std::sync::atomic::{AtomicU64, Ordering};
|
||||
use std::sync::atomic::{AtomicUsize, Ordering};
|
||||
use std::sync::Arc;
|
||||
|
||||
type FxIndexSet<K> = indexmap::IndexSet<K, BuildHasherDefault<FxHasher>>;
|
||||
|
@ -69,7 +69,7 @@ where
|
|||
/// Read current value of the revision counter.
|
||||
pub(crate) fn current_revision(&self) -> Revision {
|
||||
Revision {
|
||||
generation: self.shared_state.revision.load(Ordering::SeqCst),
|
||||
generation: self.shared_state.revision.load(Ordering::SeqCst) as u64,
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -80,7 +80,7 @@ where
|
|||
}
|
||||
|
||||
let result = Revision {
|
||||
generation: 1 + self.shared_state.revision.fetch_add(1, Ordering::SeqCst),
|
||||
generation: 1 + self.shared_state.revision.fetch_add(1, Ordering::SeqCst) as u64,
|
||||
};
|
||||
|
||||
debug!("increment_revision: incremented to {:?}", result);
|
||||
|
@ -167,7 +167,8 @@ where
|
|||
/// State that will be common to all threads (when we support multiple threads)
|
||||
struct SharedState<DB: Database> {
|
||||
storage: DB::DatabaseStorage,
|
||||
revision: AtomicU64,
|
||||
// Ideally, this should be `AtomicU64`, but that is currently unstable.
|
||||
revision: AtomicUsize,
|
||||
}
|
||||
|
||||
/// State that will be specific to a single execution threads (when we
|
||||
|
|
|
@ -1,5 +1,3 @@
|
|||
#![feature(underscore_imports)]
|
||||
|
||||
mod counter;
|
||||
mod implementation;
|
||||
mod log;
|
||||
|
|
Loading…
Reference in a new issue