5
5
* file, You can obtain one at https://mozilla.org/MPL/2.0/.
6
6
*/
7
7
8
- use std:: sync:: atomic:: { AtomicU32 , Ordering } ;
9
-
10
8
#[ cfg( not( feature = "experimental-threads" ) ) ]
11
9
use godot_cell:: panicking:: { GdCell , InaccessibleGuard , MutGuard , RefGuard } ;
12
10
@@ -22,7 +20,6 @@ pub struct InstanceStorage<T: GodotClass> {
22
20
23
21
// Declared after `user_instance`, is dropped last
24
22
pub ( super ) lifecycle : AtomicLifecycle ,
25
- godot_ref_count : AtomicU32 ,
26
23
27
24
// No-op in Release mode.
28
25
borrow_tracker : DebugBorrowTracker ,
@@ -49,7 +46,6 @@ unsafe impl<T: GodotClass> Storage for InstanceStorage<T> {
49
46
user_instance : GdCell :: new ( user_instance) ,
50
47
base,
51
48
lifecycle : AtomicLifecycle :: new ( Lifecycle :: Alive ) ,
52
- godot_ref_count : AtomicU32 :: new ( 1 ) ,
53
49
borrow_tracker : DebugBorrowTracker :: new ( ) ,
54
50
}
55
51
}
@@ -104,19 +100,11 @@ unsafe impl<T: GodotClass> Storage for InstanceStorage<T> {
104
100
}
105
101
106
102
impl < T : GodotClass > StorageRefCounted for InstanceStorage < T > {
107
- fn godot_ref_count ( & self ) -> u32 {
108
- self . godot_ref_count . load ( Ordering :: Relaxed )
109
- }
110
-
111
103
fn on_inc_ref ( & self ) {
112
- self . godot_ref_count . fetch_add ( 1 , Ordering :: Relaxed ) ;
113
-
114
104
super :: log_inc_ref ( self ) ;
115
105
}
116
106
117
107
fn on_dec_ref ( & self ) {
118
- self . godot_ref_count . fetch_sub ( 1 , Ordering :: Relaxed ) ;
119
-
120
108
super :: log_dec_ref ( self ) ;
121
109
}
122
110
}
0 commit comments