diff options
Diffstat (limited to 'src/universe.cpp')
-rw-r--r-- | src/universe.cpp | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/src/universe.cpp b/src/universe.cpp index 283747f..eab5977 100644 --- a/src/universe.cpp +++ b/src/universe.cpp | |||
@@ -119,7 +119,8 @@ void Universe::callOnStateCreate(lua_State* const L_, lua_State* const from_, Lo | |||
119 | // ################################################################################################# | 119 | // ################################################################################################# |
120 | 120 | ||
121 | // only called from the master state | 121 | // only called from the master state |
122 | [[nodiscard]] Universe* Universe::Create(lua_State* const L_) | 122 | [[nodiscard]] |
123 | Universe* Universe::Create(lua_State* const L_) | ||
123 | { | 124 | { |
124 | LUA_ASSERT(L_, Universe::Get(L_) == nullptr); | 125 | LUA_ASSERT(L_, Universe::Get(L_) == nullptr); |
125 | static constexpr StackIndex kIdxSettings{ 1 }; | 126 | static constexpr StackIndex kIdxSettings{ 1 }; |
@@ -194,7 +195,8 @@ void Universe::callOnStateCreate(lua_State* const L_, lua_State* const from_, Lo | |||
194 | // ################################################################################################# | 195 | // ################################################################################################# |
195 | 196 | ||
196 | // same as PUC-Lua l_alloc | 197 | // same as PUC-Lua l_alloc |
197 | [[nodiscard]] static void* libc_lua_Alloc([[maybe_unused]] void* ud_, [[maybe_unused]] void* ptr_, [[maybe_unused]] size_t osize_, size_t nsize_) | 198 | [[nodiscard]] |
199 | static void* libc_lua_Alloc([[maybe_unused]] void* ud_, [[maybe_unused]] void* ptr_, [[maybe_unused]] size_t osize_, size_t nsize_) | ||
198 | { | 200 | { |
199 | if (nsize_ == 0) { | 201 | if (nsize_ == 0) { |
200 | free(ptr_); | 202 | free(ptr_); |
@@ -206,7 +208,8 @@ void Universe::callOnStateCreate(lua_State* const L_, lua_State* const from_, Lo | |||
206 | 208 | ||
207 | // ################################################################################################# | 209 | // ################################################################################################# |
208 | 210 | ||
209 | [[nodiscard]] static int luaG_provide_protected_allocator(lua_State* const L_) | 211 | [[nodiscard]] |
212 | static int luaG_provide_protected_allocator(lua_State* const L_) | ||
210 | { | 213 | { |
211 | Universe* const _U{ Universe::Get(L_) }; | 214 | Universe* const _U{ Universe::Get(L_) }; |
212 | // push a new full userdata on the stack, giving access to the universe's protected allocator | 215 | // push a new full userdata on the stack, giving access to the universe's protected allocator |