diff options
| author | bors <bors@rust-lang.org> | 2014-05-03 10:56:57 -0700 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2014-05-03 10:56:57 -0700 |
| commit | 0c691df8acaf10aa3721476e5d7fafcee11b0aaa (patch) | |
| tree | 7aca9144c64039fea0aff444e13870b4be40fae7 /src/libsync | |
| parent | bca9647cd34c78a1c7c2409fbb2c31cb2c8194d7 (diff) | |
| parent | a5be12ce7e88c1d28de1c98215991127d1e765f0 (diff) | |
| download | rust-0c691df8acaf10aa3721476e5d7fafcee11b0aaa.tar.gz rust-0c691df8acaf10aa3721476e5d7fafcee11b0aaa.zip | |
auto merge of #13773 : brson/rust/boxxy, r=alexcrichton
`box` is the way you allocate in future-rust.
Diffstat (limited to 'src/libsync')
| -rw-r--r-- | src/libsync/arc.rs | 2 | ||||
| -rw-r--r-- | src/libsync/raw.rs | 6 |
2 files changed, 4 insertions, 4 deletions
diff --git a/src/libsync/arc.rs b/src/libsync/arc.rs index ecfeade2fb4..b5c66075952 100644 --- a/src/libsync/arc.rs +++ b/src/libsync/arc.rs @@ -70,7 +70,7 @@ impl<T: Share + Send> Arc<T> { pub fn new(data: 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 = ~ArcInner { + let x = box ArcInner { strong: atomics::AtomicUint::new(1), weak: atomics::AtomicUint::new(1), data: data, diff --git a/src/libsync/raw.rs b/src/libsync/raw.rs index eb90797395e..6ab833a19ef 100644 --- a/src/libsync/raw.rs +++ b/src/libsync/raw.rs @@ -109,7 +109,7 @@ struct SemGuard<'a, Q> { impl<Q: Send> Sem<Q> { fn new(count: int, q: Q) -> Sem<Q> { let inner = unsafe { - cast::transmute(~SemInner { + cast::transmute(box SemInner { waiters: WaitQueue::new(), count: count, blocked: q, @@ -726,7 +726,7 @@ mod tests { let (tx, rx) = channel(); let m = Arc::new(Mutex::new()); let m2 = m.clone(); - let mut sharedstate = ~0; + let mut sharedstate = box 0; { let ptr: *mut int = &mut *sharedstate; task::spawn(proc() { @@ -895,7 +895,7 @@ mod tests { // mutex mutual exclusion test, a ways above. let (tx, rx) = channel(); let x2 = x.clone(); - let mut sharedstate = ~0; + let mut sharedstate = box 0; { let ptr: *int = &*sharedstate; task::spawn(proc() { |
