File tree Expand file tree Collapse file tree 1 file changed +2
-4
lines changed Expand file tree Collapse file tree 1 file changed +2
-4
lines changed Original file line number Diff line number Diff line change @@ -19,8 +19,7 @@ macro_rules! class {
19
19
#[ inline( always) ]
20
20
fn get_class( name: & str ) -> Option <& ' static $crate:: runtime:: Class > {
21
21
unsafe {
22
- #[ cfg_attr( feature = "cargo-clippy" , allow( replace_consts) ) ]
23
- static CLASS : :: std:: sync:: atomic:: AtomicUsize = :: std:: sync:: atomic:: ATOMIC_USIZE_INIT ;
22
+ static CLASS : :: std:: sync:: atomic:: AtomicUsize = :: std:: sync:: atomic:: AtomicUsize :: new( 0 ) ;
24
23
// `Relaxed` should be fine since `objc_getClass` is thread-safe.
25
24
let ptr = CLASS . load( :: std:: sync:: atomic:: Ordering :: Relaxed ) as * const $crate:: runtime:: Class ;
26
25
if ptr. is_null( ) {
@@ -49,8 +48,7 @@ macro_rules! sel_impl {
49
48
#[ inline( always) ]
50
49
fn register_sel( name: & str ) -> $crate:: runtime:: Sel {
51
50
unsafe {
52
- #[ cfg_attr( feature = "cargo-clippy" , allow( replace_consts) ) ]
53
- static SEL : :: std:: sync:: atomic:: AtomicUsize = :: std:: sync:: atomic:: ATOMIC_USIZE_INIT ;
51
+ static SEL : :: std:: sync:: atomic:: AtomicUsize = :: std:: sync:: atomic:: AtomicUsize :: new( 0 ) ;
54
52
let ptr = SEL . load( :: std:: sync:: atomic:: Ordering :: Relaxed ) as * const :: std:: os:: raw:: c_void;
55
53
// It should be fine to use `Relaxed` ordering here because `sel_registerName` is
56
54
// thread-safe.
You can’t perform that action at this time.
0 commit comments