mirror of
https://github.com/mutouyun/cpp-ipc.git
synced 2025-12-07 01:06:45 +08:00
void automatic memory recovery
This commit is contained in:
parent
f3eb6ba55a
commit
1fd8e27994
@ -69,8 +69,8 @@ public:
|
|||||||
master_allocs_.emplace(std::move(alc));
|
master_allocs_.emplace(std::move(alc));
|
||||||
}
|
}
|
||||||
else const_cast<alloc_policy&>(*it).swap(alc);
|
else const_cast<alloc_policy&>(*it).swap(alc);
|
||||||
if (master_allocs_.size() <= 32) return;
|
// if (master_allocs_.size() <= 32) return;
|
||||||
take_first_do([](alloc_policy &) {}); // erase first
|
// take_first_do([](alloc_policy &) {}); // erase first
|
||||||
}
|
}
|
||||||
|
|
||||||
constexpr static auto try_replenish(alloc_policy&, std::size_t) noexcept {}
|
constexpr static auto try_replenish(alloc_policy&, std::size_t) noexcept {}
|
||||||
|
|||||||
@ -33,13 +33,13 @@ private slots:
|
|||||||
|
|
||||||
#include "test_mem.moc"
|
#include "test_mem.moc"
|
||||||
|
|
||||||
// constexpr int DataMin = 4;
|
constexpr int DataMin = 4;
|
||||||
// constexpr int DataMax = 256;
|
constexpr int DataMax = 256;
|
||||||
// constexpr int LoopCount = 4194304;
|
constexpr int LoopCount = 4194304;
|
||||||
|
|
||||||
constexpr int DataMin = 256;
|
// constexpr int DataMin = 256;
|
||||||
constexpr int DataMax = 512;
|
// constexpr int DataMax = 512;
|
||||||
constexpr int LoopCount = 2097152;
|
// constexpr int LoopCount = 2097152;
|
||||||
|
|
||||||
std::vector<std::size_t> sizes__;
|
std::vector<std::size_t> sizes__;
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user