From 18b3c5f8ed3651f326256e064e613813482c5f12 Mon Sep 17 00:00:00 2001 From: Siarhei Fedartsou Date: Thu, 11 Jul 2024 20:25:55 +0200 Subject: [PATCH] wip --- include/util/pool_allocator.hpp | 21 --------------------- src/util/pool_allocator.cpp | 2 -- 2 files changed, 23 deletions(-) diff --git a/include/util/pool_allocator.hpp b/include/util/pool_allocator.hpp index 4758c8210..0c96c0808 100644 --- a/include/util/pool_allocator.hpp +++ b/include/util/pool_allocator.hpp @@ -15,25 +15,6 @@ namespace osrm::util #if 1 -class Cleanup { -public: - static void CleanupAtExit(void* p) { - std::lock_guard lock(mutex_); - allocated_blocks_.push_back(static_cast(p)); - } - - ~Cleanup() { - std::lock_guard lock(mutex_); - for (auto block : allocated_blocks_) { - std::free(block); - } - } - -private: - static std::vector allocated_blocks_; - static std::mutex mutex_; -}; - template class PoolAllocator; @@ -104,8 +85,6 @@ private: { throw std::bad_alloc(); } - Cleanup::CleanupAtExit(block); - total_allocated_ += block_size; blocks_.push_back(block); current_block_ptr_ = block; diff --git a/src/util/pool_allocator.cpp b/src/util/pool_allocator.cpp index 5a4cd5b70..4b55e524c 100644 --- a/src/util/pool_allocator.cpp +++ b/src/util/pool_allocator.cpp @@ -2,6 +2,4 @@ namespace osrm::util { - std::vector Cleanup::allocated_blocks_; - std::mutex Cleanup::mutex_; } // namespace osrm::util \ No newline at end of file