@@ -23,9 +23,9 @@ use crate::types::{
2323} ;
2424use crate :: userdata:: { AnyUserData , MetaMethod , UserData , UserDataRegistry , UserDataVariant } ;
2525use crate :: util:: {
26- assert_stack, check_stack, get_destructed_userdata_metatable, get_gc_userdata , get_main_state,
27- get_userdata, init_error_registry, init_gc_metatable , init_userdata_metatable, pop_error,
28- push_gc_userdata , push_string, push_table, rawset_field, safe_pcall, safe_xpcall, short_type_name,
26+ assert_stack, check_stack, get_destructed_userdata_metatable, get_internal_userdata , get_main_state,
27+ get_userdata, init_error_registry, init_internal_metatable , init_userdata_metatable, pop_error,
28+ push_internal_userdata , push_string, push_table, rawset_field, safe_pcall, safe_xpcall, short_type_name,
2929 StackGuard , WrappedFailure ,
3030} ;
3131use crate :: value:: { FromLuaMulti , IntoLua , MultiValue , Nil , Value } ;
@@ -171,15 +171,15 @@ impl RawLua {
171171 // Create the internal metatables and store them in the registry
172172 // to prevent from being garbage collected.
173173
174- init_gc_metatable :: <Rc <UnsafeCell <ExtraData >>>( state, None ) ?;
175- init_gc_metatable :: <Callback >( state, None ) ?;
176- init_gc_metatable :: <CallbackUpvalue >( state, None ) ?;
174+ init_internal_metatable :: <XRc <UnsafeCell <ExtraData >>>( state, None ) ?;
175+ init_internal_metatable :: <Callback >( state, None ) ?;
176+ init_internal_metatable :: <CallbackUpvalue >( state, None ) ?;
177177 #[ cfg( feature = "async" ) ]
178178 {
179- init_gc_metatable :: <AsyncCallback >( state, None ) ?;
180- init_gc_metatable :: <AsyncCallbackUpvalue >( state, None ) ?;
181- init_gc_metatable :: <AsyncPollUpvalue >( state, None ) ?;
182- init_gc_metatable :: <Option <Waker >>( state, None ) ?;
179+ init_internal_metatable :: <AsyncCallback >( state, None ) ?;
180+ init_internal_metatable :: <AsyncCallbackUpvalue >( state, None ) ?;
181+ init_internal_metatable :: <AsyncPollUpvalue >( state, None ) ?;
182+ init_internal_metatable :: <Option <Waker >>( state, None ) ?;
183183 }
184184
185185 // Init serde metatables
@@ -550,7 +550,7 @@ impl RawLua {
550550 Value :: UserData ( ud) => self . push_ref ( & ud. 0 ) ,
551551 Value :: Error ( err) => {
552552 let protect = !self . unlikely_memory_error ( ) ;
553- push_gc_userdata ( state, WrappedFailure :: Error ( * err. clone ( ) ) , protect) ?;
553+ push_internal_userdata ( state, WrappedFailure :: Error ( * err. clone ( ) ) , protect) ?;
554554 }
555555 }
556556 Ok ( ( ) )
@@ -625,7 +625,7 @@ impl RawLua {
625625 ffi:: LUA_TUSERDATA => {
626626 // If the userdata is `WrappedFailure`, process it as an error or panic.
627627 let failure_mt_ptr = ( * self . extra . get ( ) ) . wrapped_failure_mt_ptr ;
628- match get_gc_userdata :: < WrappedFailure > ( state, idx, failure_mt_ptr) . as_mut ( ) {
628+ match get_internal_userdata :: < WrappedFailure > ( state, idx, failure_mt_ptr) . as_mut ( ) {
629629 Some ( WrappedFailure :: Error ( err) ) => Value :: Error ( Box :: new ( err. clone ( ) ) ) ,
630630 Some ( WrappedFailure :: Panic ( panic) ) => {
631631 if let Some ( panic) = panic. take ( ) {
@@ -1076,7 +1076,7 @@ impl RawLua {
10761076 let func = mem:: transmute :: < Callback , Callback < ' static > > ( func) ;
10771077 let extra = XRc :: clone ( & self . extra ) ;
10781078 let protect = !self . unlikely_memory_error ( ) ;
1079- push_gc_userdata ( state, CallbackUpvalue { data : func, extra } , protect) ?;
1079+ push_internal_userdata ( state, CallbackUpvalue { data : func, extra } , protect) ?;
10801080 if protect {
10811081 protect_lua ! ( state, 1 , 1 , fn ( state) {
10821082 ffi:: lua_pushcclosure( state, call_callback, 1 ) ;
@@ -1115,7 +1115,7 @@ impl RawLua {
11151115 let fut = func ( rawlua, args) ;
11161116 let extra = XRc :: clone ( & ( * upvalue) . extra ) ;
11171117 let protect = !rawlua. unlikely_memory_error ( ) ;
1118- push_gc_userdata ( state, AsyncPollUpvalue { data : fut, extra } , protect) ?;
1118+ push_internal_userdata ( state, AsyncPollUpvalue { data : fut, extra } , protect) ?;
11191119 if protect {
11201120 protect_lua ! ( state, 1 , 1 , fn ( state) {
11211121 ffi:: lua_pushcclosure( state, poll_future, 1 ) ;
@@ -1176,7 +1176,7 @@ impl RawLua {
11761176 let extra = XRc :: clone ( & self . extra ) ;
11771177 let protect = !self . unlikely_memory_error ( ) ;
11781178 let upvalue = AsyncCallbackUpvalue { data : func, extra } ;
1179- push_gc_userdata ( state, upvalue, protect) ?;
1179+ push_internal_userdata ( state, upvalue, protect) ?;
11801180 if protect {
11811181 protect_lua ! ( state, 1 , 1 , fn ( state) {
11821182 ffi:: lua_pushcclosure( state, call_callback, 1 ) ;
0 commit comments