Hello, I have question regarding the pool library. In my application I read a lot of data records from a database into a small data class and therefor I thought object_pool could help me to reduce memory consumption.
So I wrote: class OuterClass { ... class row{ ... private: ... static boost::object_pool<OuterClass::row> p; }; }; In OuterClass.cc I do boost::object_pool<OuterClass::row> OuterClass::row::p; inline void * OuterClass::row::operator new(size_t size){ return p.malloc(); } inline void OuterClass::row::operator delete(void *p, size_t size){ } The code works. However every time I instantiate a OuterClass::row p.malloc is called. Is there a way to reduce the calls to p.malloc ? Normally I know the rough number of rows I fetch from the database, say 100.000 . So it would be a great thing to allocate memory for 10.000 * sizeof(OuterClass::row) and later only to glide on this memory chunk. Can anyone give me a hint if and how to achieve that ? Thomas -- Please avoid sending me Word or PowerPoint attachments. See http://www.fsf.org/philosophy/no-word-attachments.html _______________________________________________ Unsubscribe & other changes: http://lists.boost.org/mailman/listinfo.cgi/boost