Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r70813 - in sandbox/guild/pool: boost/pool libs/pool/doc
From: john_at_[hidden]
Date: 2011-04-01 07:11:26


Author: johnmaddock
Date: 2011-04-01 07:11:25 EDT (Fri, 01 Apr 2011)
New Revision: 70813
URL: http://svn.boost.org/trac/boost/changeset/70813

Log:
Fix template param descriptions.
Cross reference docs.
Add concept docs.
Text files modified:
   sandbox/guild/pool/boost/pool/object_pool.hpp | 8 ++++----
   sandbox/guild/pool/boost/pool/pool.hpp | 10 +++++++---
   sandbox/guild/pool/libs/pool/doc/jamfile.v2 | 2 +-
   sandbox/guild/pool/libs/pool/doc/pool.qbk | 25 +++++++++++++++++++++++++
   4 files changed, 37 insertions(+), 8 deletions(-)

Modified: sandbox/guild/pool/boost/pool/object_pool.hpp
==============================================================================
--- sandbox/guild/pool/boost/pool/object_pool.hpp (original)
+++ sandbox/guild/pool/boost/pool/object_pool.hpp 2011-04-01 07:11:25 EDT (Fri, 01 Apr 2011)
@@ -45,12 +45,12 @@
 
 \details
 
-_at_tparam T type of object to allocate/deallocate.
- \pre T must have a non-throwing destructor.
+<b>T</b> The type of object to allocate/deallocate.
+T must have a non-throwing destructor.
 
-_at_tparam UserAllocator\n
+<b>UserAllocator</b>
 Defines the allocator that the underlying Pool will use to allocate memory from the system.
-See User Allocators for details.
+See User Allocators for details.
 
 Class object_pool is a template class
 that can be used for fast and efficient memory allocation of objects.

Modified: sandbox/guild/pool/boost/pool/pool.hpp
==============================================================================
--- sandbox/guild/pool/boost/pool/pool.hpp (original)
+++ sandbox/guild/pool/boost/pool/pool.hpp 2011-04-01 07:11:25 EDT (Fri, 01 Apr 2011)
@@ -84,7 +84,9 @@
  namespace boost
 {
 
-//! Default User allocator new used as default template parameter for UserAllocator. Uese new and delete.
+//! \brief Default allocator used as default template parameter for
+//! a UserAllocator
+//! template parameter. Uses new and delete.
 struct default_user_allocator_new_delete
 {
   typedef std::size_t size_type; //!< An unsigned integral type that can represent the size of the largest object to be allocated.
@@ -101,8 +103,10 @@
   }
 };
 
- //! Default User allocator malloc used as template parameter.
- struct default_user_allocator_malloc_free
+//! \brief UserAllocator
+//! used as template parameter for \ref pool and \ref object_pool.
+//! Uses malloc and free internally.
+struct default_user_allocator_malloc_free
 {
   typedef std::size_t size_type; //!< An unsigned integral type that can represent the size of the largest object to be allocated.
   typedef std::ptrdiff_t difference_type; //!< A signed integral type that can represent the difference of any two pointers.

Modified: sandbox/guild/pool/libs/pool/doc/jamfile.v2
==============================================================================
--- sandbox/guild/pool/libs/pool/doc/jamfile.v2 (original)
+++ sandbox/guild/pool/libs/pool/doc/jamfile.v2 2011-04-01 07:11:25 EDT (Fri, 01 Apr 2011)
@@ -135,7 +135,7 @@
                 <format>html:<xsl:param>html.cellspacing=3 # pixels
                 # Vertical spacing in table cells.
                 <format>html:<xsl:param>html.cellpadding=5 # pixels
- # Not sure if these are right way round?
+ <format>html:<xsl:param>boost.max.id.part.length=40
 
                 # PDF Options:
                 # ============

Modified: sandbox/guild/pool/libs/pool/doc/pool.qbk
==============================================================================
--- sandbox/guild/pool/libs/pool/doc/pool.qbk (original)
+++ sandbox/guild/pool/libs/pool/doc/pool.qbk 2011-04-01 07:11:25 EDT (Fri, 01 Apr 2011)
@@ -1012,6 +1012,31 @@
 
 [endsect] [/section:simple_segregated_storage]
 
+[section:user_allocator The UserAllocator Concept]
+
+Pool objects need to request memory blocks from the system, which the Pool then splits into chunks to allocate
+to the user. By specifying a UserAllocator template parameter to various Pool interfaces, users can control how
+those system memory blocks are allocated.
+
+In the following table, /UserAllocator/ is a User Allocator type,
+/block/ is a value of type char *, and
+/n/ is a value of type UserAllocator::size_type
+
+[table UserAllocator Requirements
+[[Expression][Result][Description]]
+[[UserAllocator::size_type][][An unsigned integral type that can represent the size of the largest object to be allocated.]]
+[[UserAllocator::difference_type][][A signed integral type that can represent the difference of any two pointers.]]
+[[UserAllocator::malloc(n)][char *][Attempts to allocate n bytes from the system. Returns 0 if out-of-memory.]]
+[[UserAllocator::free(block)][void][block must have been previously returned from a call to UserAllocator::malloc.]]
+]
+
+There are two UserAllocator classes provided in this library:
+[classref boost::default_user_allocator_new_delete `default_user_allocator_new_delete`] and
+[classref boost::default_user_allocator_malloc_free `default_user_allocator_malloc_free`],
+both in pool.hpp. The default value for the template parameter UserAllocator is always
+[classref boost::default_user_allocator_new_delete `default_user_allocator_new_delete`].
+
+[endsect][/section:user_allocator The UserAllocator Concept]
 [endsect] [/section:pooling Pool in more depth]
 
 [xinclude autodoc.xml] [/ Boost.Pool Reference section, using Doxygen reference documentation.]


Boost-Commit list run by bdawes at acm.org, david.abrahams at rcn.com, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk