aboutsummaryrefslogtreecommitdiff
path: root/deep_test
diff options
context:
space:
mode:
authorBenoit Germain <benoit.germain@ubisoft.com>2025-02-05 12:27:02 +0100
committerBenoit Germain <benoit.germain@ubisoft.com>2025-02-05 12:27:02 +0100
commit05e4cce366cccf92ad88f80695efa548fae187de (patch)
tree3332753154ecd89a87d7fdd6a4f9383d1b66ed1f /deep_test
parent59ae58fd31d63c261372bd5a36765328583bc1b6 (diff)
downloadlanes-05e4cce366cccf92ad88f80695efa548fae187de.tar.gz
lanes-05e4cce366cccf92ad88f80695efa548fae187de.tar.bz2
lanes-05e4cce366cccf92ad88f80695efa548fae187de.zip
Minor internal code tweaks
* mark all eligible classes Final * new TableIndex strong type * buildfixes for HAVE_DEBUGSPEW() * overridden virtual destructors tagged as such
Diffstat (limited to 'deep_test')
-rw-r--r--deep_test/deep_test.cpp9
1 files changed, 5 insertions, 4 deletions
diff --git a/deep_test/deep_test.cpp b/deep_test/deep_test.cpp
index dbc0115..46f99d9 100644
--- a/deep_test/deep_test.cpp
+++ b/deep_test/deep_test.cpp
@@ -2,12 +2,13 @@
2#include "lanes/src/deep.hpp" 2#include "lanes/src/deep.hpp"
3#include "lanes/src/compat.hpp" 3#include "lanes/src/compat.hpp"
4 4
5class MyDeepFactory : public DeepFactory 5class MyDeepFactory final : public DeepFactory
6{ 6{
7 public: 7 public:
8 static MyDeepFactory Instance; 8 static MyDeepFactory Instance;
9 9
10 private: 10 private:
11 ~MyDeepFactory() override = default;
11 12
12 private: 13 private:
13 void createMetatable(lua_State* const L_) const override 14 void createMetatable(lua_State* const L_) const override
@@ -77,11 +78,11 @@ static int deep_get(lua_State* const L_)
77// ################################################################################################# 78// #################################################################################################
78 79
79[[nodiscard]] 80[[nodiscard]]
80static int deep_tostring(lua_State* L) 81static int deep_tostring(lua_State* const L_)
81{ 82{
82 MyDeepUserdata* const _self{ static_cast<MyDeepUserdata*>(MyDeepFactory::Instance.toDeep(L, StackIndex{ 1 })) }; 83 MyDeepUserdata* const _self{ static_cast<MyDeepUserdata*>(MyDeepFactory::Instance.toDeep(L_, StackIndex{ 1 })) };
83 _self->inUse.fetch_add(1, std::memory_order_seq_cst); 84 _self->inUse.fetch_add(1, std::memory_order_seq_cst);
84 luaG_pushstring(L, "%p:deep(%d)", _self, _self->val); 85 luaG_pushstring(L_, "%p:deep(%d)", _self, _self->val);
85 _self->inUse.fetch_sub(1, std::memory_order_seq_cst); 86 _self->inUse.fetch_sub(1, std::memory_order_seq_cst);
86 return 1; 87 return 1;
87} 88}