diff options
author | Alex Orlenko <zxteam@protonmail.com> | 2021-07-08 18:40:14 +0100 |
---|---|---|
committer | Alex Orlenko <zxteam@protonmail.com> | 2021-07-08 18:40:14 +0100 |
commit | 60822d12d2fdafcccb6c1051e8eea8fa64d33d28 (patch) | |
tree | 63744b0b2d7edb64d9145b710805b26300ccca38 /src/thread.rs | |
parent | 8ff610529b32b2949737c83d3e813f5d5d4f3cbd (diff) | |
download | mlua-60822d12d2fdafcccb6c1051e8eea8fa64d33d28.zip |
Revert "Move away from metatable hashmap cache to direct keys"
This reverts commit adbc9ccc9be5d24ff56275938aebb11529ec7399.
Diffstat (limited to 'src/thread.rs')
-rw-r--r-- | src/thread.rs | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/thread.rs b/src/thread.rs index 7a10d46..403eb78 100644 --- a/src/thread.rs +++ b/src/thread.rs @@ -13,7 +13,7 @@ use crate::function::Function; #[cfg(feature = "async")] use { crate::{ - lua::{ASYNC_POLL_PENDING, WAKER_MT, WAKER_REGISTRY_KEY}, + lua::{ASYNC_POLL_PENDING, WAKER_REGISTRY_KEY}, util::get_gc_userdata, value::Value, }, @@ -362,7 +362,7 @@ impl WakerGuard { let waker_key = &WAKER_REGISTRY_KEY as *const u8 as *const c_void; ffi::lua_rawgetp(state, ffi::LUA_REGISTRYINDEX, waker_key); - let waker_slot = get_gc_userdata::<Option<Waker>>(state, -1, &WAKER_MT).as_mut(); + let waker_slot = get_gc_userdata::<Option<Waker>>(state, -1).as_mut(); let old = mlua_expect!(waker_slot, "Waker is destroyed").replace(waker); Ok(WakerGuard(state, old)) @@ -380,7 +380,7 @@ impl Drop for WakerGuard { let waker_key = &WAKER_REGISTRY_KEY as *const u8 as *const c_void; ffi::lua_rawgetp(state, ffi::LUA_REGISTRYINDEX, waker_key); - let waker_slot = get_gc_userdata::<Option<Waker>>(state, -1, &WAKER_MT).as_mut(); + let waker_slot = get_gc_userdata::<Option<Waker>>(state, -1).as_mut(); mem::swap(mlua_expect!(waker_slot, "Waker is destroyed"), &mut self.1); } } |