Skip to content

Commit 8e45a72

Browse files
committed
Remove no longer used GlobalRegistry
1 parent 6cd8126 commit 8e45a72

File tree

2 files changed

+0
-77
lines changed

2 files changed

+0
-77
lines changed

godot-ffi/src/global_registry.rs

Lines changed: 0 additions & 51 deletions
This file was deleted.

godot-ffi/src/lib.rs

Lines changed: 0 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@
1919
)]
2020
pub(crate) mod gen;
2121

22-
mod global_registry;
2322
mod godot_ffi;
2423
mod opaque;
2524
mod plugins;
@@ -33,16 +32,12 @@ pub use crate::godot_ffi::{GodotFfi, GodotFuncMarshal};
3332
pub use gen::central::*;
3433
pub use gen::gdextension_interface::*;
3534

36-
use crate::global_registry::GlobalRegistry; // needs `crate::`
37-
3835
// ----------------------------------------------------------------------------------------------------------------------------------------------
39-
// Real implementation, when Godot engine is running
4036

4137
struct GodotBinding {
4238
interface: GDExtensionInterface,
4339
library: GDExtensionClassLibraryPtr,
4440
method_table: GlobalMethodTable,
45-
registry: GlobalRegistry,
4641
}
4742

4843
/// Late-init globals
@@ -69,7 +64,6 @@ pub unsafe fn initialize(
6964
BINDING = Some(GodotBinding {
7065
interface: *interface,
7166
method_table: GlobalMethodTable::new(&*interface),
72-
registry: GlobalRegistry::default(),
7367
library,
7468
});
7569
}
@@ -98,17 +92,6 @@ pub unsafe fn method_table() -> &'static GlobalMethodTable {
9892
&unwrap_ref_unchecked(&BINDING).method_table
9993
}
10094

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-
11295
/// Makes sure that Godot is running, or panics. Debug mode only!
11396
macro_rules! debug_assert_godot {
11497
($expr:expr) => {
@@ -130,15 +113,6 @@ unsafe fn unwrap_ref_unchecked<T>(opt: &Option<T>) -> &T {
130113
}
131114
}
132115

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-
142116
// ----------------------------------------------------------------------------------------------------------------------------------------------
143117

144118
#[macro_export]

0 commit comments

Comments
 (0)