Implementation Details
Implementing reference counting is a delicate, nontrivial task. The same goes for explaining it. Instead of re-inventing the wheel, we chose to base our performance discussion on the reference counting implementation developed by Meyers in item 29 of “More Effective C++” [Mey96], for several reasons:
It is an efficient implementation, given what it set out to accomplish.
It is explained very well in [Mey96]. You may refer to it for more details than we provide here.
Many people may already be familiar with this particular implementation.
Let's start with a Widget class and evolve it into a reference-counted one. The Widget class contains a member pointing to heap memory (Meyers uses a String class in his initial demonstration ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access