diff options
| author | bors <bors@rust-lang.org> | 2019-01-18 11:34:11 +0000 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2019-01-18 11:34:11 +0000 |
| commit | 527b8d424392dd7d89cfaa4dfdaec4df226c8018 (patch) | |
| tree | e8b13998619187e3cd143cf6f964e75b16f35c16 /src/librustc_data_structures | |
| parent | 38650b69cafbff61d71a275ced1e9866a08a36c0 (diff) | |
| parent | 13136787849c960db824b2ad15d227dc15fadd70 (diff) | |
| download | rust-527b8d424392dd7d89cfaa4dfdaec4df226c8018.tar.gz rust-527b8d424392dd7d89cfaa4dfdaec4df226c8018.zip | |
Auto merge of #57065 - Zoxc:graph-tweaks, r=michaelwoerister
Optimize try_mark_green and eliminate the lock on dep node colors Blocked on https://github.com/rust-lang/rust/pull/56614 r? @michaelwoerister
Diffstat (limited to 'src/librustc_data_structures')
| -rw-r--r-- | src/librustc_data_structures/sync.rs | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/src/librustc_data_structures/sync.rs b/src/librustc_data_structures/sync.rs index f9f94f0be7b..0253eef4dfa 100644 --- a/src/librustc_data_structures/sync.rs +++ b/src/librustc_data_structures/sync.rs @@ -70,6 +70,7 @@ cfg_if! { pub struct Atomic<T: Copy>(Cell<T>); impl<T: Copy> Atomic<T> { + #[inline] pub fn new(v: T) -> Self { Atomic(Cell::new(v)) } @@ -80,10 +81,12 @@ cfg_if! { self.0.into_inner() } + #[inline] pub fn load(&self, _: Ordering) -> T { self.0.get() } + #[inline] pub fn store(&self, val: T, _: Ordering) { self.0.set(val) } @@ -118,6 +121,7 @@ cfg_if! { pub type AtomicUsize = Atomic<usize>; pub type AtomicBool = Atomic<bool>; + pub type AtomicU32 = Atomic<u32>; pub type AtomicU64 = Atomic<u64>; pub use self::serial_join as join; @@ -223,7 +227,7 @@ cfg_if! { pub use parking_lot::MutexGuard as LockGuard; pub use parking_lot::MappedMutexGuard as MappedLockGuard; - pub use std::sync::atomic::{AtomicBool, AtomicUsize, AtomicU64}; + pub use std::sync::atomic::{AtomicBool, AtomicUsize, AtomicU32, AtomicU64}; pub use std::sync::Arc as Lrc; pub use std::sync::Weak as Weak; |
