-
Book Overview & Buying
-
Table Of Contents
C++ Memory Management
By :
This has been an eventful chapter, has it not? After venturing into explicit and implicit memory allocation implementations in Chapter 12 and Chapter 13, this chapter explored allocators and how these facilities let us customize the behavior of memory allocation in containers to match our needs.
We saw how a traditional allocator, ensconced in the type of its enclosing container, can be implemented and used. We did so with a container that trades in contiguous memory as well as with a node-based container. We also looked at how the task of writing (and using) such allocators evolved through the years to become the contemporary traits-based allocators that implicitly synthesize default implementations for most allocator services.
We then looked at the more recent PMR allocator model that represents a different take on memory allocation and discussed its upsides and downsides. Equipped with the knowledge in this chapter, you should have ideas of ways in which containers...