diff options
| author | bors <bors@rust-lang.org> | 2015-01-12 22:56:20 +0000 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2015-01-12 22:56:20 +0000 |
| commit | 3d0d9bb6fbdf6ead9396f0874cf38f3ef7c9be5c (patch) | |
| tree | 9994c5b80534154e0130716d304d9185e7ae3481 /src/liballoc | |
| parent | 3a44a19af29585c02e81e22ea7665f829ae0590a (diff) | |
| parent | 8b6cda3ce681d4d95c3097d12ed754975b4a07f6 (diff) | |
| download | rust-3d0d9bb6fbdf6ead9396f0874cf38f3ef7c9be5c.tar.gz rust-3d0d9bb6fbdf6ead9396f0874cf38f3ef7c9be5c.zip | |
auto merge of #20896 : sfackler/rust/atomic-rename, r=alexcrichton
Change any use of AtomicInt to AtomicIsize and AtomicUint to AtomicUsize Closes #20893 [breaking-change]
Diffstat (limited to 'src/liballoc')
| -rw-r--r-- | src/liballoc/arc.rs | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/src/liballoc/arc.rs b/src/liballoc/arc.rs index 290dd21d666..c0cd034abfa 100644 --- a/src/liballoc/arc.rs +++ b/src/liballoc/arc.rs @@ -137,8 +137,8 @@ unsafe impl<T: Sync + Send> Send for Weak<T> { } unsafe impl<T: Sync + Send> Sync for Weak<T> { } struct ArcInner<T> { - strong: atomic::AtomicUint, - weak: atomic::AtomicUint, + strong: atomic::AtomicUsize, + weak: atomic::AtomicUsize, data: T, } @@ -161,8 +161,8 @@ impl<T> Arc<T> { // Start the weak pointer count as 1 which is the weak pointer that's // held by all the strong pointers (kinda), see std/rc.rs for more info let x = box ArcInner { - strong: atomic::AtomicUint::new(1), - weak: atomic::AtomicUint::new(1), + strong: atomic::AtomicUsize::new(1), + weak: atomic::AtomicUsize::new(1), data: data, }; Arc { _ptr: unsafe { NonZero::new(mem::transmute(x)) } } @@ -619,7 +619,7 @@ mod tests { use super::{Arc, Weak, weak_count, strong_count}; use std::sync::Mutex; - struct Canary(*mut atomic::AtomicUint); + struct Canary(*mut atomic::AtomicUsize); impl Drop for Canary { @@ -743,16 +743,16 @@ mod tests { #[test] fn drop_arc() { - let mut canary = atomic::AtomicUint::new(0); - let x = Arc::new(Canary(&mut canary as *mut atomic::AtomicUint)); + let mut canary = atomic::AtomicUsize::new(0); + let x = Arc::new(Canary(&mut canary as *mut atomic::AtomicUsize)); drop(x); assert!(canary.load(Acquire) == 1); } #[test] fn drop_arc_weak() { - let mut canary = atomic::AtomicUint::new(0); - let arc = Arc::new(Canary(&mut canary as *mut atomic::AtomicUint)); + let mut canary = atomic::AtomicUsize::new(0); + let arc = Arc::new(Canary(&mut canary as *mut atomic::AtomicUsize)); let arc_weak = arc.downgrade(); assert!(canary.load(Acquire) == 0); drop(arc); |
