55 * file, You can obtain one at https://mozilla.org/MPL/2.0/.
66 */
77
8- use std:: sync:: atomic:: { AtomicU32 , Ordering } ;
9-
108#[ cfg( not( feature = "experimental-threads" ) ) ]
119use godot_cell:: panicking:: { GdCell , InaccessibleGuard , MutGuard , RefGuard } ;
1210
@@ -22,7 +20,6 @@ pub struct InstanceStorage<T: GodotClass> {
2220
2321 // Declared after `user_instance`, is dropped last
2422 pub ( super ) lifecycle : AtomicLifecycle ,
25- godot_ref_count : AtomicU32 ,
2623
2724 // No-op in Release mode.
2825 borrow_tracker : DebugBorrowTracker ,
@@ -49,7 +46,6 @@ unsafe impl<T: GodotClass> Storage for InstanceStorage<T> {
4946 user_instance : GdCell :: new ( user_instance) ,
5047 base,
5148 lifecycle : AtomicLifecycle :: new ( Lifecycle :: Alive ) ,
52- godot_ref_count : AtomicU32 :: new ( 1 ) ,
5349 borrow_tracker : DebugBorrowTracker :: new ( ) ,
5450 }
5551 }
@@ -104,19 +100,11 @@ unsafe impl<T: GodotClass> Storage for InstanceStorage<T> {
104100}
105101
106102impl < T : GodotClass > StorageRefCounted for InstanceStorage < T > {
107- fn godot_ref_count ( & self ) -> u32 {
108- self . godot_ref_count . load ( Ordering :: Relaxed )
109- }
110-
111103 fn on_inc_ref ( & self ) {
112- self . godot_ref_count . fetch_add ( 1 , Ordering :: Relaxed ) ;
113-
114104 super :: log_inc_ref ( self ) ;
115105 }
116106
117107 fn on_dec_ref ( & self ) {
118- self . godot_ref_count . fetch_sub ( 1 , Ordering :: Relaxed ) ;
119-
120108 super :: log_dec_ref ( self ) ;
121109 }
122110}
0 commit comments