19
19
) ]
20
20
pub ( crate ) mod gen;
21
21
22
- mod global_registry;
23
22
mod godot_ffi;
24
23
mod opaque;
25
24
mod plugins;
@@ -33,16 +32,12 @@ pub use crate::godot_ffi::{GodotFfi, GodotFuncMarshal};
33
32
pub use gen:: central:: * ;
34
33
pub use gen:: gdextension_interface:: * ;
35
34
36
- use crate :: global_registry:: GlobalRegistry ; // needs `crate::`
37
-
38
35
// ----------------------------------------------------------------------------------------------------------------------------------------------
39
- // Real implementation, when Godot engine is running
40
36
41
37
struct GodotBinding {
42
38
interface : GDExtensionInterface ,
43
39
library : GDExtensionClassLibraryPtr ,
44
40
method_table : GlobalMethodTable ,
45
- registry : GlobalRegistry ,
46
41
}
47
42
48
43
/// Late-init globals
@@ -69,7 +64,6 @@ pub unsafe fn initialize(
69
64
BINDING = Some ( GodotBinding {
70
65
interface : * interface,
71
66
method_table : GlobalMethodTable :: new ( & * interface) ,
72
- registry : GlobalRegistry :: default ( ) ,
73
67
library,
74
68
} ) ;
75
69
}
@@ -98,17 +92,6 @@ pub unsafe fn method_table() -> &'static GlobalMethodTable {
98
92
& unwrap_ref_unchecked ( & BINDING ) . method_table
99
93
}
100
94
101
- /// # Safety
102
- ///
103
- /// The interface must have been initialised with [`initialize`] before calling this function.
104
- ///
105
- /// Calling this while another place holds a reference (threads, re-entrancy, iteration, etc) is immediate undefined behavior.
106
- // note: could potentially avoid &mut aliasing, using UnsafeCell/RefCell
107
- #[ inline( always) ]
108
- pub unsafe fn get_registry ( ) -> & ' static mut GlobalRegistry {
109
- & mut unwrap_ref_unchecked_mut ( & mut BINDING ) . registry
110
- }
111
-
112
95
/// Makes sure that Godot is running, or panics. Debug mode only!
113
96
macro_rules! debug_assert_godot {
114
97
( $expr: expr) => {
@@ -130,15 +113,6 @@ unsafe fn unwrap_ref_unchecked<T>(opt: &Option<T>) -> &T {
130
113
}
131
114
}
132
115
133
- unsafe fn unwrap_ref_unchecked_mut < T > ( opt : & mut Option < T > ) -> & mut T {
134
- debug_assert_godot ! ( opt. is_some( ) ) ;
135
-
136
- match opt {
137
- Some ( ref mut val) => val,
138
- None => std:: hint:: unreachable_unchecked ( ) ,
139
- }
140
- }
141
-
142
116
// ----------------------------------------------------------------------------------------------------------------------------------------------
143
117
144
118
#[ macro_export]
0 commit comments