48template <
typename AllocT>
57 return instance().request_impl();
62 static auto release(std::shared_ptr<AllocT>& _v)
65 return instance().release_impl(_v);
69 using alloctor_array_t = std::vector<std::shared_ptr<AllocT>>;
71 std::shared_ptr<AllocT> request_impl()
73 m_data.emplace_back(std::make_shared<AllocT>());
77 int64_t release_impl(std::shared_ptr<AllocT>& _v)
81 auto itr = m_data.begin();
82 for(; itr != m_data.end(); ++itr)
84 if(itr->get() == _v.get())
87 if(itr == m_data.end())
89 auto _count = itr->use_count();
96 alloctor_array_t m_data = {};
std::unique_lock< mutex_t > auto_lock_t
Unique lock type around mutex_t.
Ensures that allocators which have state are not deleted until all handles to the allocator have been...
static auto release(std::shared_ptr< AllocT > &_v)
shared_stateful_allocator< AllocT > this_type