-
Book Overview & Buying
-
Table Of Contents
C++ Memory Management
By :
This chapter took us in the territory of deferred reclamation, a territory that’s unfamiliar to many C++ programmers. We saw ways in which we can reclaim objects in groups at specific points in a program, discussed restrictions on what could be done when reclaiming such objects, and examined various techniques to finalize objects before freeing their associated memory storage.
We are now ready to look at how memory management interacts with C++ containers, an important topic that will occupy us in the next three chapters.
Indeed, we could write containers that handle memory explicitly, but in general, that would be counterproductive (for example, if we tied std::vector<T> to new and delete, how could std::vector<T> handle some type T for which allocation and deallocation have to be done through other means?).
There are, of course, quite a few ways to get there. Want to know some of them? Let’s take a deep breath and dive in…