diff options
Diffstat (limited to 'src/universe.h')
-rw-r--r-- | src/universe.h | 36 |
1 files changed, 4 insertions, 32 deletions
diff --git a/src/universe.h b/src/universe.h index 8244980..4ed1776 100644 --- a/src/universe.h +++ b/src/universe.h | |||
@@ -9,7 +9,7 @@ extern "C" | |||
9 | } | 9 | } |
10 | #endif // __cplusplus | 10 | #endif // __cplusplus |
11 | 11 | ||
12 | #include "macros_and_utils.h" | 12 | #include "lanesconf.h" |
13 | #include "tracker.h" | 13 | #include "tracker.h" |
14 | #include "uniquekey.h" | 14 | #include "uniquekey.h" |
15 | 15 | ||
@@ -54,11 +54,6 @@ class AllocatorDefinition | |||
54 | allocF = lua_getallocf(L_, &allocUD); | 54 | allocF = lua_getallocf(L_, &allocUD); |
55 | } | 55 | } |
56 | 56 | ||
57 | void* lua_alloc(void* ptr_, size_t osize_, size_t nsize_) | ||
58 | { | ||
59 | allocF(allocUD, ptr_, osize_, nsize_); | ||
60 | } | ||
61 | |||
62 | void* alloc(size_t nsize_) | 57 | void* alloc(size_t nsize_) |
63 | { | 58 | { |
64 | return allocF(allocUD, nullptr, 0, nsize_); | 59 | return allocF(allocUD, nullptr, 0, nsize_); |
@@ -185,6 +180,9 @@ class Universe | |||
185 | Universe& operator=(Universe const&) = delete; | 180 | Universe& operator=(Universe const&) = delete; |
186 | Universe& operator=(Universe&&) = delete; | 181 | Universe& operator=(Universe&&) = delete; |
187 | 182 | ||
183 | void closeKeepers(); | ||
184 | void initializeAllocatorFunction(lua_State* L_); | ||
185 | void initializeKeepers(lua_State* L_); | ||
188 | void terminateFreeRunningLanes(lua_State* L_, lua_Duration shutdownTimeout_, CancelOp op_); | 186 | void terminateFreeRunningLanes(lua_State* L_, lua_Duration shutdownTimeout_, CancelOp op_); |
189 | }; | 187 | }; |
190 | 188 | ||
@@ -196,32 +194,6 @@ void universe_store(lua_State* L_, Universe* U_); | |||
196 | 194 | ||
197 | // ################################################################################################# | 195 | // ################################################################################################# |
198 | 196 | ||
199 | #if USE_DEBUG_SPEW() | ||
200 | class DebugSpewIndentScope | ||
201 | { | ||
202 | private: | ||
203 | Universe* const U; | ||
204 | |||
205 | public: | ||
206 | static char const* const debugspew_indent; | ||
207 | |||
208 | DebugSpewIndentScope(Universe* U_) | ||
209 | : U{ U_ } | ||
210 | { | ||
211 | if (U) | ||
212 | U->debugspewIndentDepth.fetch_add(1, std::memory_order_relaxed); | ||
213 | } | ||
214 | |||
215 | ~DebugSpewIndentScope() | ||
216 | { | ||
217 | if (U) | ||
218 | U->debugspewIndentDepth.fetch_sub(1, std::memory_order_relaxed); | ||
219 | } | ||
220 | }; | ||
221 | #endif // USE_DEBUG_SPEW() | ||
222 | |||
223 | // ################################################################################################# | ||
224 | |||
225 | [[nodiscard]] inline Universe* universe_get(lua_State* L_) | 197 | [[nodiscard]] inline Universe* universe_get(lua_State* L_) |
226 | { | 198 | { |
227 | STACK_CHECK_START_REL(L_, 0); | 199 | STACK_CHECK_START_REL(L_, 0); |