From 1fd8e279946871c14b70244c8d3d36e988ad03b1 Mon Sep 17 00:00:00 2001 From: mutouyun Date: Mon, 7 Oct 2019 12:18:26 +0000 Subject: [PATCH] void automatic memory recovery --- src/memory/wrapper.h | 4 ++-- test/test_mem.cpp | 12 ++++++------ 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/src/memory/wrapper.h b/src/memory/wrapper.h index 42cdfee..f0a20d0 100755 --- a/src/memory/wrapper.h +++ b/src/memory/wrapper.h @@ -69,8 +69,8 @@ public: master_allocs_.emplace(std::move(alc)); } else const_cast(*it).swap(alc); - if (master_allocs_.size() <= 32) return; - take_first_do([](alloc_policy &) {}); // erase first + // if (master_allocs_.size() <= 32) return; + // take_first_do([](alloc_policy &) {}); // erase first } constexpr static auto try_replenish(alloc_policy&, std::size_t) noexcept {} diff --git a/test/test_mem.cpp b/test/test_mem.cpp index 733701a..e82007f 100755 --- a/test/test_mem.cpp +++ b/test/test_mem.cpp @@ -33,13 +33,13 @@ private slots: #include "test_mem.moc" -// constexpr int DataMin = 4; -// constexpr int DataMax = 256; -// constexpr int LoopCount = 4194304; +constexpr int DataMin = 4; +constexpr int DataMax = 256; +constexpr int LoopCount = 4194304; -constexpr int DataMin = 256; -constexpr int DataMax = 512; -constexpr int LoopCount = 2097152; +// constexpr int DataMin = 256; +// constexpr int DataMax = 512; +// constexpr int LoopCount = 2097152; std::vector sizes__;