@@ -1616,7 +1616,7 @@ impl<T: ?Sized, A: Allocator> Arc<T, A> {
1616
1616
#[ must_use]
1617
1617
#[ stable( feature = "arc_counts" , since = "1.15.0" ) ]
1618
1618
pub fn weak_count ( this : & Self ) -> usize {
1619
- let cnt = this. inner ( ) . weak . load ( Acquire ) ;
1619
+ let cnt = this. inner ( ) . weak . load ( Relaxed ) ;
1620
1620
// If the weak count is currently locked, the value of the
1621
1621
// count was 0 just before taking the lock.
1622
1622
if cnt == usize:: MAX { 0 } else { cnt - 1 }
@@ -1646,7 +1646,7 @@ impl<T: ?Sized, A: Allocator> Arc<T, A> {
1646
1646
#[ must_use]
1647
1647
#[ stable( feature = "arc_counts" , since = "1.15.0" ) ]
1648
1648
pub fn strong_count ( this : & Self ) -> usize {
1649
- this. inner ( ) . strong . load ( Acquire )
1649
+ this. inner ( ) . strong . load ( Relaxed )
1650
1650
}
1651
1651
1652
1652
/// Increments the strong reference count on the `Arc<T>` associated with the
@@ -2801,7 +2801,7 @@ impl<T: ?Sized, A: Allocator> Weak<T, A> {
2801
2801
#[ must_use]
2802
2802
#[ stable( feature = "weak_counts" , since = "1.41.0" ) ]
2803
2803
pub fn strong_count ( & self ) -> usize {
2804
- if let Some ( inner) = self . inner ( ) { inner. strong . load ( Acquire ) } else { 0 }
2804
+ if let Some ( inner) = self . inner ( ) { inner. strong . load ( Relaxed ) } else { 0 }
2805
2805
}
2806
2806
2807
2807
/// Gets an approximation of the number of `Weak` pointers pointing to this
@@ -2820,7 +2820,7 @@ impl<T: ?Sized, A: Allocator> Weak<T, A> {
2820
2820
pub fn weak_count ( & self ) -> usize {
2821
2821
if let Some ( inner) = self . inner ( ) {
2822
2822
let weak = inner. weak . load ( Acquire ) ;
2823
- let strong = inner. strong . load ( Acquire ) ;
2823
+ let strong = inner. strong . load ( Relaxed ) ;
2824
2824
if strong == 0 {
2825
2825
0
2826
2826
} else {
0 commit comments