aboutsummaryrefslogtreecommitdiff
path: root/src/linda.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/linda.cpp')
-rw-r--r--src/linda.cpp12
1 files changed, 6 insertions, 6 deletions
diff --git a/src/linda.cpp b/src/linda.cpp
index 39977bc..50964ad 100644
--- a/src/linda.cpp
+++ b/src/linda.cpp
@@ -70,7 +70,7 @@ class Linda : public DeepPrelude // Deep userdata MUST start with this header
70 public: 70 public:
71 71
72 // a fifo full userdata has one uservalue, the table that holds the actual fifo contents 72 // a fifo full userdata has one uservalue, the table that holds the actual fifo contents
73 static void* operator new(size_t size_, Universe* U_) noexcept { return U_->internal_allocator.alloc(size_); } 73 [[nodiscard]] static void* operator new(size_t size_, Universe* U_) noexcept { return U_->internal_allocator.alloc(size_); }
74 // always embedded somewhere else or "in-place constructed" as a full userdata 74 // always embedded somewhere else or "in-place constructed" as a full userdata
75 // can't actually delete the operator because the compiler generates stack unwinding code that could call it in case of exception 75 // can't actually delete the operator because the compiler generates stack unwinding code that could call it in case of exception
76 static void operator delete(void* p_, Universe* U_) { U_->internal_allocator.free(p_, sizeof(Linda)); } 76 static void operator delete(void* p_, Universe* U_) { U_->internal_allocator.free(p_, sizeof(Linda)); }
@@ -137,10 +137,10 @@ class Linda : public DeepPrelude // Deep userdata MUST start with this header
137 return nullptr; 137 return nullptr;
138 } 138 }
139}; 139};
140static void* linda_id( lua_State*, DeepOp); 140[[nodiscard]] static void* linda_id(lua_State*, DeepOp);
141 141
142template<bool OPT> 142template<bool OPT>
143static inline Linda* lua_toLinda(lua_State* L, int idx_) 143[[nodiscard]] static inline Linda* lua_toLinda(lua_State* L, int idx_)
144{ 144{
145 Linda* const linda{ static_cast<Linda*>(luaG_todeep(L, linda_id, idx_)) }; 145 Linda* const linda{ static_cast<Linda*>(luaG_todeep(L, linda_id, idx_)) };
146 if (!OPT) 146 if (!OPT)
@@ -742,7 +742,7 @@ LUAG_FUNC(linda_deep)
742*/ 742*/
743 743
744template <bool OPT> 744template <bool OPT>
745static int linda_tostring(lua_State* L, int idx_) 745[[nodiscard]] static int linda_tostring(lua_State* L, int idx_)
746{ 746{
747 Linda* const linda{ lua_toLinda<OPT>(L, idx_) }; 747 Linda* const linda{ lua_toLinda<OPT>(L, idx_) };
748 if (linda != nullptr) 748 if (linda != nullptr)
@@ -851,7 +851,7 @@ LUAG_FUNC(linda_towatch)
851* For any other strings, the ID function must not react at all. This allows 851* For any other strings, the ID function must not react at all. This allows
852* future extensions of the system. 852* future extensions of the system.
853*/ 853*/
854static void* linda_id( lua_State* L, DeepOp op_) 854[[nodiscard]] static void* linda_id(lua_State* L, DeepOp op_)
855{ 855{
856 switch( op_) 856 switch( op_)
857 { 857 {
@@ -907,7 +907,7 @@ static void* linda_id( lua_State* L, DeepOp op_)
907 // Clean associated structures in the keeper state. 907 // Clean associated structures in the keeper state.
908 Keeper* const K{ need_acquire_release ? keeper_acquire(linda->U->keepers, linda->hashSeed()) : myK }; 908 Keeper* const K{ need_acquire_release ? keeper_acquire(linda->U->keepers, linda->hashSeed()) : myK };
909 // hopefully this won't ever raise an error as we would jump to the closest pcall site while forgetting to release the keeper mutex... 909 // hopefully this won't ever raise an error as we would jump to the closest pcall site while forgetting to release the keeper mutex...
910 keeper_call(linda->U, K->L, KEEPER_API(clear), L, linda, 0); 910 std::ignore = keeper_call(linda->U, K->L, KEEPER_API(clear), L, linda, 0);
911 if (need_acquire_release) 911 if (need_acquire_release)
912 { 912 {
913 keeper_release(K); 913 keeper_release(K);