After a more detailed examination of the documentation boost.pool, I think I understand my confusion. I am used to thinking about an object pool implemented as a class that allocates and manages a set of direct objects. Consider
template<class T>
class object_pool {
private:
std::list<T*> m_reserved;
public
T *acquire() { }
};
However, it seems that it boost.poolimplements a different concept of the pool of objects, which is used for a completely different purpose than the one proposed above. boost.poolallocates and manages the base memory of the desired object (s), presumably so that it can increase heap performance using what it describes as Simple Segregated Storage . Actually, this concept of an object pool template does not follow . An explanation of the differences between the two patterns can be found in the answer to my next question .
source
share