aboutsummaryrefslogtreecommitdiff
path: root/src/uniquekey.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/uniquekey.h')
-rw-r--r--src/uniquekey.h5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/uniquekey.h b/src/uniquekey.h
index a89ecd3..78c0765 100644
--- a/src/uniquekey.h
+++ b/src/uniquekey.h
@@ -13,12 +13,15 @@ class UniqueKey
13 13
14 public: 14 public:
15 15
16 constexpr explicit UniqueKey(uint64_t val_) 16 char const* m_debugName{ nullptr };
17
18 constexpr explicit UniqueKey(uint64_t val_, char const* debugName_ = nullptr)
17#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 19#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
18 : m_storage{ static_cast<uintptr_t>(val_ & 0x7fffffffffffull) } 20 : m_storage{ static_cast<uintptr_t>(val_ & 0x7fffffffffffull) }
19#else // LUAJIT_FLAVOR() 21#else // LUAJIT_FLAVOR()
20 : m_storage{ static_cast<uintptr_t>(val_) } 22 : m_storage{ static_cast<uintptr_t>(val_) }
21#endif // LUAJIT_FLAVOR() 23#endif // LUAJIT_FLAVOR()
24 , m_debugName{ debugName_ }
22 { 25 {
23 } 26 }
24 constexpr UniqueKey(UniqueKey const& rhs_) = default; 27 constexpr UniqueKey(UniqueKey const& rhs_) = default;