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