Have you registered for CppCon 2015 in September? Don’t delay – Registration is open now.
While we wait for this year’s event, we’re featuring videos of some of the 100+ talks from CppCon 2014 for you to enjoy. Here is today’s feature:
Making Allocators Work, Part II
by Alisdair Meredith
Summary of the talk:
Memory is an important property for every object, as whatever resources it manages, it must occupy some memory. THe ability to customize memory allocation is important for every C++ program that cares about performance, debug ability and support.
The original C++ standard supported an allocator parameter for every container, yet this feature was widely derided or ignored, as it was underspecified to the point it could not portably be used. C++11 makes significant changes to the allocator model, that simply its use while making it more powerful.
The Library Fundamentals TS goes further, allowing allocators’ type to be supplied at runtime, rather than compile type, using classic object oriented polymorphism - yet building on the infrastructure laid down in C++11.
This material should be of interest to both library authors and consumers, although clearly there are more details for the implementers to absorb. It also includes an interesting case study in C++11 compile time reflection, as required to implement the new ‘allocator_traits’ facility.
Add a Comment
Comments are closed.