-
Book Overview & Buying
-
Table Of Contents
C++ Memory Management
By :
We now have a plan, so we are ready to start implementing the initial version of our leak detector. This implementation will be slightly naïve but will help us understand the general idea; we will examine the more delicate aspects of the implementation once the basic infrastructure is in place. Do not use this first version in production code as it will be (slightly yet dangerously) incorrect. We will provide a correct version later in this chapter, of course.
As a suggestion, try to see if you can identify the “rough edges” of our implementation by yourself before we cover them later in this chapter. There will be clues left here and there for you, and if you read the chapters that preceded this one, you might already have an idea of what you should be looking for.
Our Accountant class will be a reification of the singleton design pattern whose role will be to allow the global overloads...