-
Book Overview & Buying
-
Table Of Contents
C++ Memory Management
By :
You can find the code files for this chapter in the book’s GitHub repository here: https://github.com/PacktPublishing/C-Plus-Plus-Memory-Management/tree/main/chapter14.
A word about the examples in this chapter
As was the case with Chapter 13, this chapter will show incomplete examples to avoid redundancy with the excerpts found earlier, particularly those in Chapter 12. Allocators change the way in which containers interact with memory management facilities, but they do not require rewriting containers entirely, so a lot of code written for a given container remains stable regardless of how memory is managed. The code you will find in the GitHub repository is, of course, complete.
Also note that this chapter discusses allocators in the context of containers, but the idea can be extended to many types that need to dynamically allocate memory. It is sometimes difficult to do so; for example, support for allocators in std::function was removed in...