2 Nov
2009
2 Nov
'09
3:38 p.m.
AMDG Hansjoerg wrote:
In my application I have a lot of small objects. For that I thought that it is the best to use an object pool..I have read the docu of object_pool...but I don't understand really how I have to use it..
{ boost::object_pool<int> pool; for(int i = 0; i < 100; ++i) { int* ip = pool.malloc(); } } // all allocated objects freed here
Another thing that I don't understand..Need I to know already during compiletime the max. number of objects?
No. object_pool will allocate more memory on demand. In Christ, Steven Watanabe