Skip to content

Rename AtomicInt and AtomicUint #20896

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jan 13, 2015
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 9 additions & 9 deletions src/liballoc/arc.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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,
}

Expand All @@ -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)) } }
Expand Down Expand Up @@ -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
{
Expand Down Expand Up @@ -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);
Expand Down
4 changes: 2 additions & 2 deletions src/libcollections/vec.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2199,7 +2199,7 @@ mod tests {

#[test]
fn test_map_in_place_zero_drop_count() {
use std::sync::atomic::{AtomicUint, Ordering, ATOMIC_UINT_INIT};
use std::sync::atomic::{AtomicUsize, Ordering, ATOMIC_USIZE_INIT};

#[derive(Clone, PartialEq, Show)]
struct Nothing;
Expand All @@ -2213,7 +2213,7 @@ mod tests {
}
}
const NUM_ELEMENTS: uint = 2;
static DROP_COUNTER: AtomicUint = ATOMIC_UINT_INIT;
static DROP_COUNTER: AtomicUsize = ATOMIC_USIZE_INIT;

let v = repeat(Nothing).take(NUM_ELEMENTS).collect::<Vec<_>>();

Expand Down
Loading