aboutsummaryrefslogtreecommitdiff
path: root/src/uniquekey.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/uniquekey.h')
-rw-r--r--src/uniquekey.h14
1 files changed, 7 insertions, 7 deletions
diff --git a/src/uniquekey.h b/src/uniquekey.h
index 984ef50..da699b0 100644
--- a/src/uniquekey.h
+++ b/src/uniquekey.h
@@ -10,19 +10,19 @@
10class UniqueKey 10class UniqueKey
11{ 11{
12 protected: 12 protected:
13 uintptr_t const m_storage{ 0 }; 13 uintptr_t const storage{ 0 };
14 14
15 public: 15 public:
16 char const* m_debugName{ nullptr }; 16 char const* debugName{ nullptr };
17 17
18 // --------------------------------------------------------------------------------------------- 18 // ---------------------------------------------------------------------------------------------
19 constexpr explicit UniqueKey(uint64_t val_, char const* debugName_ = nullptr) 19 constexpr explicit UniqueKey(uint64_t val_, char const* debugName_ = nullptr)
20#if LUAJIT_FLAVOR() == 64 // building against LuaJIT headers for 64 bits, light userdata is restricted to 47 significant bits, because LuaJIT uses the other bits for internal optimizations 20#if LUAJIT_FLAVOR() == 64 // building against LuaJIT headers for 64 bits, light userdata is restricted to 47 significant bits, because LuaJIT uses the other bits for internal optimizations
21 : m_storage{ static_cast<uintptr_t>(val_ & 0x7FFFFFFFFFFFull) } 21 : storage{ static_cast<uintptr_t>(val_ & 0x7FFFFFFFFFFFull) }
22#else // LUAJIT_FLAVOR() 22#else // LUAJIT_FLAVOR()
23 : m_storage{ static_cast<uintptr_t>(val_) } 23 : storage{ static_cast<uintptr_t>(val_) }
24#endif // LUAJIT_FLAVOR() 24#endif // LUAJIT_FLAVOR()
25 , m_debugName{ debugName_ } 25 , debugName{ debugName_ }
26 { 26 {
27 } 27 }
28 // --------------------------------------------------------------------------------------------- 28 // ---------------------------------------------------------------------------------------------
@@ -32,12 +32,12 @@ class UniqueKey
32 // --------------------------------------------------------------------------------------------- 32 // ---------------------------------------------------------------------------------------------
33 bool equals(lua_State* const L_, int i_) const 33 bool equals(lua_State* const L_, int i_) const
34 { 34 {
35 return lua_touserdata(L_, i_) == std::bit_cast<void*>(m_storage); 35 return lua_touserdata(L_, i_) == std::bit_cast<void*>(storage);
36 } 36 }
37 // --------------------------------------------------------------------------------------------- 37 // ---------------------------------------------------------------------------------------------
38 void pushKey(lua_State* const L_) const 38 void pushKey(lua_State* const L_) const
39 { 39 {
40 lua_pushlightuserdata(L_, std::bit_cast<void*>(m_storage)); 40 lua_pushlightuserdata(L_, std::bit_cast<void*>(storage));
41 } 41 }
42}; 42};
43 43