Boost C++ Libraries

...one of the most highly regarded and expertly designed C++ library projects in the world. Herb Sutter and Andrei Alexandrescu, C++ Coding Standards

Click here to view the latest version of this page.
PrevUpHomeNext

Appendix F: Other Implementations

Pool allocators are found in many programming languages, and in many variations. The beginnings of many implementations may be found in common programming literature; some of these are given below. Note that none of these are complete implementations of a Pool; most of these leave some aspects of a Pool as a user exercise. However, in each case, even though some aspects are missing, these examples use the same underlying concept of a Simple Segregated Storage described in this document.

  1. The C++ Programming Language, 3rd ed., by Bjarne Stroustrup, Section 19.4.2. Missing aspects:
    • Not portable.
    • Cannot handle allocations of arbitrary numbers of objects (this was left as an exercise).
    • Not thread-safe.
    • Suffers from the static initialization problem.
  2. MicroC/OS-II: The Real-Time Kernel, by Jean J. Labrosse, Chapter 7 and Appendix B.04.
    • An example of the Simple Segregated Storage scheme at work in the internals of an actual OS.
    • Missing aspects:
    • Not portable (though this is OK, since it's part of its own OS).
    • Cannot handle allocations of arbitrary numbers of blocks (which is also OK, since this feature is not needed).
    • Requires non-intuitive user code to create and destroy the Pool.
  3. Efficient C++: Performance Programming Techniques, by Dov Bulka and David Mayhew, Chapters 6 and 7.
    • This is a good example of iteratively developing a Pool solutio.
    • however, their premise (that the system-supplied allocation mechanism is hopelessly inefficient) is flawed on every system I've tested on.
    • Run their timings on your system before you accept their conclusions.
    • Missing aspect: Requires non-intuitive user code to create and destroy the Pool.
  4. Advanced C++: Programming Styles and Idioms, by James O. Coplien, Section 3.6.
    • Has examples of both static and dynamic pooling, but missing aspects:
    • Not thread-safe.
    • The static pooling example is not portable.

PrevUpHomeNext