From c3f84bfe9c37df94abaff9eaf73cba23ede32c44 Mon Sep 17 00:00:00 2001 From: Benoit Germain Date: Tue, 29 Apr 2025 17:39:09 +0200 Subject: Move ProtectedAllocator::Protected_lua_Alloc in universe.cpp --- src/universe.cpp | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'src/universe.cpp') diff --git a/src/universe.cpp b/src/universe.cpp index 0f41585..06f7f21 100644 --- a/src/universe.cpp +++ b/src/universe.cpp @@ -51,6 +51,16 @@ static constexpr RegistryUniqueKey kUniverseFullRegKey{ 0x1C2D76870DD9DD9Full }; // ################################################################################################# +[[nodiscard]] +void* ProtectedAllocator::Protected_lua_Alloc(void* const ud_, void* const ptr_, size_t const osize_, size_t const nsize_) +{ + ProtectedAllocator* const _allocator{ static_cast(ud_) }; + std::lock_guard _guard{ _allocator->mutex }; + return _allocator->alloc(ptr_, osize_, nsize_); +} + +// ################################################################################################# + Universe::Universe() { //--- -- cgit v1.2.3-55-g6feb