@@ -137,8 +137,8 @@ unsafe impl<T: Sync + Send> Send for Weak<T> { }
137
137
unsafe impl < T : Sync + Send > Sync for Weak < T > { }
138
138
139
139
struct ArcInner < T > {
140
- strong : atomic:: AtomicUint ,
141
- weak : atomic:: AtomicUint ,
140
+ strong : atomic:: AtomicUsize ,
141
+ weak : atomic:: AtomicUsize ,
142
142
data : T ,
143
143
}
144
144
@@ -161,8 +161,8 @@ impl<T> Arc<T> {
161
161
// Start the weak pointer count as 1 which is the weak pointer that's
162
162
// held by all the strong pointers (kinda), see std/rc.rs for more info
163
163
let x = box ArcInner {
164
- strong : atomic:: AtomicUint :: new ( 1 ) ,
165
- weak : atomic:: AtomicUint :: new ( 1 ) ,
164
+ strong : atomic:: AtomicUsize :: new ( 1 ) ,
165
+ weak : atomic:: AtomicUsize :: new ( 1 ) ,
166
166
data : data,
167
167
} ;
168
168
Arc { _ptr : unsafe { NonZero :: new ( mem:: transmute ( x) ) } }
@@ -619,7 +619,7 @@ mod tests {
619
619
use super :: { Arc , Weak , weak_count, strong_count} ;
620
620
use std:: sync:: Mutex ;
621
621
622
- struct Canary ( * mut atomic:: AtomicUint ) ;
622
+ struct Canary ( * mut atomic:: AtomicUsize ) ;
623
623
624
624
impl Drop for Canary
625
625
{
@@ -743,16 +743,16 @@ mod tests {
743
743
744
744
#[ test]
745
745
fn drop_arc ( ) {
746
- let mut canary = atomic:: AtomicUint :: new ( 0 ) ;
747
- let x = Arc :: new ( Canary ( & mut canary as * mut atomic:: AtomicUint ) ) ;
746
+ let mut canary = atomic:: AtomicUsize :: new ( 0 ) ;
747
+ let x = Arc :: new ( Canary ( & mut canary as * mut atomic:: AtomicUsize ) ) ;
748
748
drop ( x) ;
749
749
assert ! ( canary. load( Acquire ) == 1 ) ;
750
750
}
751
751
752
752
#[ test]
753
753
fn drop_arc_weak ( ) {
754
- let mut canary = atomic:: AtomicUint :: new ( 0 ) ;
755
- let arc = Arc :: new ( Canary ( & mut canary as * mut atomic:: AtomicUint ) ) ;
754
+ let mut canary = atomic:: AtomicUsize :: new ( 0 ) ;
755
+ let arc = Arc :: new ( Canary ( & mut canary as * mut atomic:: AtomicUsize ) ) ;
756
756
let arc_weak = arc. downgrade ( ) ;
757
757
assert ! ( canary. load( Acquire ) == 0 ) ;
758
758
drop ( arc) ;
0 commit comments