On 10/07/2014 04:11 p.m., Niall Douglas wrote:
On 9 Jul 2014 at 22:53, Felipe Magno de Almeida wrote:
I would hope Allocators would be added to ASIO in the standard. It is difficult to limit memory usage without Allocators in embedded systems.
http://www.boost.org/doc/html/boost_asio/overview/core/allocation.html
I do not know if it is used consistently inside Asio itself.
Last time I checked it didn't used allocators on data structures, for example for buckets in a linked list. This might have changed by then. At that time Christopher didn't want to template the whole library to add allocator support, he had already tried and thought it to be impractical.
Nor are allocators consistently used for internals of STL containers. They have to be used for the type being stored of course, but internal data structures not exposed to external code may use any allocator e.g. malloc().
That is precisely why we have `uses_allocator` and `scoped_allocator_adaptor`. http://en.cppreference.com/w/cpp/memory/scoped_allocator_adaptor Regards, -- Agustín K-ballo Bergé.- http://talesofcpp.fusionfenix.com