diff options
Diffstat (limited to 'src/tools.cpp')
-rw-r--r-- | src/tools.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/tools.cpp b/src/tools.cpp index 103122e..df7602e 100644 --- a/src/tools.cpp +++ b/src/tools.cpp | |||
@@ -156,7 +156,7 @@ void luaG_dump( lua_State* L) | |||
156 | // ################################################################################################ | 156 | // ################################################################################################ |
157 | 157 | ||
158 | // same as PUC-Lua l_alloc | 158 | // same as PUC-Lua l_alloc |
159 | extern "C" static void* libc_lua_Alloc([[maybe_unused]] void* ud, [[maybe_unused]] void* ptr_, size_t osize_, size_t nsize_) | 159 | extern "C" static void* libc_lua_Alloc([[maybe_unused]] void* ud, [[maybe_unused]] void* ptr_, [[maybe_unused]] size_t osize_, size_t nsize_) |
160 | { | 160 | { |
161 | if (nsize_ == 0) | 161 | if (nsize_ == 0) |
162 | { | 162 | { |
@@ -175,7 +175,7 @@ static int luaG_provide_protected_allocator(lua_State* L) | |||
175 | { | 175 | { |
176 | Universe* const U{ universe_get(L) }; | 176 | Universe* const U{ universe_get(L) }; |
177 | // push a new full userdata on the stack, giving access to the universe's protected allocator | 177 | // push a new full userdata on the stack, giving access to the universe's protected allocator |
178 | AllocatorDefinition* const def{ new (L) AllocatorDefinition{ U->protected_allocator.makeDefinition() } }; | 178 | [[maybe_unused]] AllocatorDefinition* const def{ new (L) AllocatorDefinition{ U->protected_allocator.makeDefinition() } }; |
179 | return 1; | 179 | return 1; |
180 | } | 180 | } |
181 | 181 | ||
@@ -229,7 +229,7 @@ void initialize_allocator_function(Universe* U, lua_State* L) | |||
229 | { | 229 | { |
230 | U->internal_allocator = AllocatorDefinition{ libc_lua_Alloc, nullptr }; | 230 | U->internal_allocator = AllocatorDefinition{ libc_lua_Alloc, nullptr }; |
231 | } | 231 | } |
232 | else if (U->provide_allocator = luaG_provide_protected_allocator) | 232 | else if (U->provide_allocator == luaG_provide_protected_allocator) |
233 | { | 233 | { |
234 | // user wants mutex protection on the state's allocator. Use protection for our own allocations too, just in case. | 234 | // user wants mutex protection on the state's allocator. Use protection for our own allocations too, just in case. |
235 | U->internal_allocator = U->protected_allocator.makeDefinition(); | 235 | U->internal_allocator = U->protected_allocator.makeDefinition(); |