----- Original Message ----- From: "Douglas Gregor" <[EMAIL PROTECTED]> Newsgroups: gmane.comp.lib.boost.devel Sent: Tuesday, August 05, 2003 8:32 PM Subject: Re: what happened to allocators in boost?
> The allocator design focused on the benefits one could get from specialized > allocators for containers, e.g., data structures that may allocate large > chunks of memory that are expected to be used together. They don't really > give us much for components like shared_ptr that allocate one thing (and > note that shared_ptr does not allocate the pointer it stores, although it > does allocate a reference count). boost::function supports an allocator > argument, but the C++ committee is considering removing this allocator from > the library TR version of function<> for precisely this reason. > > Doug > Hi there. I believe that components such as shared_ptr could still benifit from allocators that are shared at the class level; for example, a singleton pool allocator could be used by all instances of the shared_ptr template. Loki uses exactly this, and it gains a performance increase of ~100% compared to using the standard ::operator new and ::operator delete under MSVC++.NET 2003, when constructing and destructing lots of shared_ptr objects (or to be more accurate, shared_count objects), i.e.: std::vector<boost::shared_ptr<double> > myDoubleVector(10000); I personally think that the benifits are still there, and with things such as template typedefs and template aliases being introduced by the standards commitee, using templates with a lot of arguments may be less painful. Jesse Towner _______________________________________________ Unsubscribe & other changes: http://lists.boost.org/mailman/listinfo.cgi/boost