2
0
mirror of https://github.com/boostorg/pool.git synced 2026-01-30 08:02:35 +00:00
Files
pool/doc/index.html
2001-06-27 04:51:35 +00:00

154 lines
7.1 KiB
HTML

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<HTML>
<HEAD>
<TITLE>Boost Pool Library</TITLE>
<LINK HREF="pool.css" REL="stylesheet" TYPE="text/css">
</HEAD>
<BODY>
<IMG SRC="../../../c++boost.gif" WIDTH=276 HEIGHT=86 ALT="C++ Boost">
<H1 ALIGN=CENTER>Boost Pool Library</H1>
<P>
<H2>Introduction</H2>
<P>
<H3>What is Pool?</H3>
<P>
Pool allocation is a memory allocation scheme that is very fast, but limited in its usage. For more information on pool allocation (also called &quot;simple segregated storage&quot;), see <A HREF="concepts.html">the concepts document</A>.
<P>
<H3>Why should I use Pool?</H3>
<P>
Using Pools gives you more control over how memory is used in your program. For example, you could have a situation where you want to allocate a bunch of small objects at one point, and then reach a point in your program where none of them are needed any more. Using pool interfaces, you can choose to run their destructors or just drop them off into oblivion; the pool interface will guarantee that there are no system memory leaks.
<P>
<H3>When should I use Pool?</H3>
<P>
Pools are generally used when there is a lot of allocation and deallocation of small objects. Another common usage is the situation above, where many objects may be dropped out of memory.
<P>
In general, use Pools when you need a more efficient way to do unusual memory control.
<P>
<H3>How do I use Pool?</H3>
<P>
See the <A HREF="interfaces.html">pool interfaces document</A>, which covers the different Pool interfaces supplied by this library.
<P>
<H2>Library Structure and Dependencies</H2>
<P>
Forward declarations of all the exposed symbols for this library are in the header <SPAN CLASS="code">&lt;boost/pool/poolfwd.hpp&gt;</SPAN>.
<P>
The library may use macros, which will be prefixed with <SPAN CLASS="code">BOOST_POOL_</SPAN>. The exception to this rule are the include file guards, which (for file <EM>xxx</EM>.hpp) is <SPAN CLASS="code">BOOST_<EM>xxx</EM>_HPP</SPAN>.
<P>
All exposed symbols defined by the library will be in namespace <SPAN CLASS="code">boost</SPAN>. All symbols used only by the implementation will be in namespace <SPAN CLASS="code">boost::details::pool</SPAN>.
<P>
Every header used only by the implementation is in the subdirectory <SPAN CLASS="code">detail/</SPAN>.
<P>
Any header in the library may include any other header in the library or any system-supplied header at its discretion.
<P>
<H2>Installation</H2>
<P>
The Boost Pool library is a header file library. That means there is no .lib, .dll, or .so to build; just add the Boost directory to your compiler's include file path, and you should be good to go!
<P>
<H2>Building the Test Programs</H2>
<P>
The subdirectory &quot;build&quot; contains subdirectories for several different platforms. These subdirectories contain all necessary work-around code for that platform, as well as makefiles or IDE project files as appropriate.
<P>
Read the &quot;readme.txt&quot; in the proper subdirectory, if it exists.
<P>
The standard makefile targets are &quot;all&quot;, &quot;clean&quot; (which deletes any intermediate files), and &quot;veryclean&quot; (which deletes any intermediate files and executables). All intermediate and executable files are built in the same directory as the makefile/project file. If there is a project file supplied instead of a makefile, &quot;clean&quot; and &quot;veryclean&quot; shell scripts/batch files will be provided.
<P>
Project files and makefiles for additional platforms may be sent to Stephen Cleary at <A HREF="mailto:shammah@voyager.net">shammah@voyager.net</A>.
<P>
<H2>Documentation Map</H2>
<UL>
<LI>Overview of Pooling
<UL>
<LI><A HREF="concepts.html">concepts.html</A> - The basic ideas behind pooling.</LI>
<LI><A HREF="implementation/alignment.html">implementation/alignment.html</A> - How we guarantee alignment portably.</LI>
<LI><A HREF="interfaces.html">interfaces.html</A> - What interfaces are provided and when to use each one.</LI>
</UL>
</LI>
<LI>Pool Exposed Interfaces
<UL>
<LI><A HREF="interfaces/simple_segregated_storage.html">interfaces/simple_segregated_storage.html</A> - Not for the faint of heart; embedded programmers only.</LI>
<LI><A HREF="interfaces/pool.html">interfaces/pool.html</A> - The basic pool interface.</LI>
<LI><A HREF="interfaces/singleton_pool.html">interfaces/singleton_pool.html</A> - The basic pool interface as a thread-safe singleton.</LI>
<LI><A HREF="interfaces/object_pool.html">interfaces/object_pool.html</A> - A type-oriented (instead of size-oriented) pool interface.</LI>
<LI><A HREF="interfaces/pool_alloc.html">interfaces/pool_alloc.html</A> - A Standard Allocator pool interface based on singleton_pool.</LI>
<LI><A HREF="interfaces/user_allocator.html">interfaces/user_allocator.html</A> - OK, not a pool interface, but it describes how the user can control how Pools allocate system memory.</LI>
</UL>
</LI>
<LI>Pool Implementation Details and Extensions
<UL>
<LI>Interface Implementations and Extensions
<UL>
<LI><A HREF="implementation/simple_segregated_storage.html">implementation/simple_segregated_storage.html</A></LI>
<LI><A HREF="implementation/pool.html">implementation/pool.html</A></LI>
<LI><A HREF="implementation/singleton_pool.html">implementation/singleton_pool.html</A></LI>
<LI><A HREF="implementation/object_pool.html">implementation/object_pool.html</A></LI>
<LI><A HREF="implementation/pool_alloc.html">implementation/pool_alloc.html</A></LI>
</UL>
</LI>
<LI>Components Used Only by the Implementation
<UL>
<LI><A HREF="implementation/ct_gcd_lcm.html">implementation/ct_gcd_lcm.html</A> - Compile-time GCD and LCM.</LI>
<LI><A HREF="implementation/for.html">implementation/for.html</A> - Description of an m4 component.</LI>
<LI><A HREF="implementation/gcd_lcm.html">implementation/gcd_lcm.html</A> - Run-time GCD and LCM.</LI>
<LI><A HREF="implementation/guard.html">implementation/guard.html</A> - Auto lock/unlock for mutex.</LI>
<LI><A HREF="implementation/mutex.html">implementation/mutex.html</A> - Platform-dependent mutex type.</LI>
<LI><A HREF="implementation/pool_construct.html">implementation/pool_construct.html</A> - The system for supporting more constructor arguments in object_pool.</LI>
<LI><A HREF="implementation/singleton.html">implementation/singleton.html</A> - Singleton that avoids static initialization problem.</LI>
</UL>
</LI>
</UL>
</LI>
</UL>
<P>
<H2>Future Directions</H2>
<P>
Another pool interface will be written: a base class for per-class pool allocation.
<P>
<H2>Acknowledgements</H2>
<P>
Many, many thanks to the Boost peers, notably Jeff Garland, Beman Dawes, Ed Brey, Gary Powell, Peter Dimov, and Jens Maurer for providing helpful suggestions!
<P>
<HR>
<P>
Copyright &copy; 2000, 2001 Stephen Cleary (<A HREF="mailto:shammah@voyager.net">shammah@voyager.net</A>)
<P>
This file can be redistributed and/or modified under the terms found in <A HREF="copyright.html">copyright.html</A>
<P>
This software and its documentation is provided &quot;as is&quot; without express or implied warranty, and with no claim as to its suitability for any purpose.
</BODY>
</HTML>