diff options
author | Benoit Germain <benoit.germain@ubisoft.com> | 2024-12-09 17:39:30 +0100 |
---|---|---|
committer | Benoit Germain <benoit.germain@ubisoft.com> | 2024-12-09 17:39:30 +0100 |
commit | 5f9ef9e1b75adc27a4ae4129cc33137aa7aaa565 (patch) | |
tree | 2500bc537a045a66ae68288f01bff569decdd80c /src/universe.hpp | |
parent | a334c7662a1a7be5b79efe72076c49ab7c714070 (diff) | |
download | lanes-5f9ef9e1b75adc27a4ae4129cc33137aa7aaa565.tar.gz lanes-5f9ef9e1b75adc27a4ae4129cc33137aa7aaa565.tar.bz2 lanes-5f9ef9e1b75adc27a4ae4129cc33137aa7aaa565.zip |
Improved DeepPrelude architecture
Diffstat (limited to 'src/universe.hpp')
-rw-r--r-- | src/universe.hpp | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/src/universe.hpp b/src/universe.hpp index 639dcdb..dbf0ece 100644 --- a/src/universe.hpp +++ b/src/universe.hpp | |||
@@ -10,8 +10,8 @@ | |||
10 | // ################################################################################################# | 10 | // ################################################################################################# |
11 | 11 | ||
12 | // forwards | 12 | // forwards |
13 | struct DeepPrelude; | ||
14 | class Lane; | 13 | class Lane; |
14 | class Linda; | ||
15 | 15 | ||
16 | // ################################################################################################# | 16 | // ################################################################################################# |
17 | 17 | ||
@@ -99,7 +99,7 @@ class Universe | |||
99 | 99 | ||
100 | // Initialized by 'init_once_LOCKED()': the deep userdata Linda object | 100 | // Initialized by 'init_once_LOCKED()': the deep userdata Linda object |
101 | // used for timers (each lane will get a proxy to this) | 101 | // used for timers (each lane will get a proxy to this) |
102 | DeepPrelude* timerLinda{ nullptr }; | 102 | Linda* timerLinda{ nullptr }; |
103 | 103 | ||
104 | LaneTracker tracker; | 104 | LaneTracker tracker; |
105 | 105 | ||
@@ -122,6 +122,9 @@ class Universe | |||
122 | // The terminal desinit sequence should wait for all such processing to terminate before force-killing threads | 122 | // The terminal desinit sequence should wait for all such processing to terminate before force-killing threads |
123 | std::atomic<int> selfdestructingCount{ 0 }; | 123 | std::atomic<int> selfdestructingCount{ 0 }; |
124 | 124 | ||
125 | private: | ||
126 | static int UniverseGC(lua_State* L_); | ||
127 | |||
125 | public: | 128 | public: |
126 | [[nodiscard]] | 129 | [[nodiscard]] |
127 | static void* operator new([[maybe_unused]] size_t size_, lua_State* L_) noexcept { return luaG_newuserdatauv<Universe>(L_, UserValueCount{ 0 }); }; | 130 | static void* operator new([[maybe_unused]] size_t size_, lua_State* L_) noexcept { return luaG_newuserdatauv<Universe>(L_, UserValueCount{ 0 }); }; |
@@ -171,7 +174,3 @@ inline void Universe::Store(lua_State* L_, Universe* U_) | |||
171 | kUniverseLightRegKey.setValue(L_, [U = U_](lua_State* L_) { U ? lua_pushlightuserdata(L_, U) : lua_pushnil(L_); }); | 174 | kUniverseLightRegKey.setValue(L_, [U = U_](lua_State* L_) { U ? lua_pushlightuserdata(L_, U) : lua_pushnil(L_); }); |
172 | STACK_CHECK(L_, 0); | 175 | STACK_CHECK(L_, 0); |
173 | } | 176 | } |
174 | |||
175 | // ################################################################################################# | ||
176 | |||
177 | LUAG_FUNC(universe_gc); | ||