Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r69274 - sandbox/guild/pool/boost/pool
From: pbristow_at_[hidden]
Date: 2011-02-25 11:36:06


Author: pbristow
Date: 2011-02-25 11:36:02 EST (Fri, 25 Feb 2011)
New Revision: 69274
URL: http://svn.boost.org/trac/boost/changeset/69274

Log:
More docs details added.
Text files modified:
   sandbox/guild/pool/boost/pool/object_pool.hpp | 51 ++++++---
   sandbox/guild/pool/boost/pool/pool_alloc.hpp | 191 ++++++++++++++++++++++++++-------------
   sandbox/guild/pool/boost/pool/simple_segregated_storage.hpp | 60 +++++------
   sandbox/guild/pool/boost/pool/singleton_pool.hpp | 61 +++++++-----
   4 files changed, 223 insertions(+), 140 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-02-25 11:36:02 EST (Fri, 25 Feb 2011)
@@ -20,7 +20,7 @@
 
 \details
 
-(&t)->~ObjectPool() Destructs the ObjectPool.\n
+(&t)->~ObjectPool() Destructs the ObjectPool.\n
 ~ElementType() is called for each allocated ElementType that has not been deallocated. O(N).\n\n
 
 Extensions to Public Interface\n
@@ -75,12 +75,18 @@
   public:
     typedef T element_type; //!< ElementType
     typedef UserAllocator user_allocator; //!<
- typedef typename pool<UserAllocator>::size_type size_type; //!< pool<UserAllocator>::size_type
+ typedef typename pool<UserAllocator>::size_type size_type; //!< pool<UserAllocator>::size_type
     typedef typename pool<UserAllocator>::difference_type difference_type; //!< pool<UserAllocator>::difference_type
 
   protected:
- pool<UserAllocator> & store() { return *this; }
- const pool<UserAllocator> & store() const { return *this; }
+ pool<UserAllocator> & store()
+ { //! \return *this
+ return *this;
+ }
+ const pool<UserAllocator> & store() const
+ { //! \return *this
+ return *this;
+ }
 
     // for the sake of code readability :)
     static void * & nextof(void * const ptr)
@@ -114,11 +120,11 @@
     }
     bool is_from(element_type * const chunk) const
     { /*! \returns true if p was allocated from u or
- may be returned as the result of a future allocation from u.
+ may be returned as the result of a future allocation from u.\n
       Returns false if p was allocated from some other pool or
       may be returned as the result of a future allocation from some other pool.
       Otherwise, the return value is meaningless.
- Note that this function may not be used to reliably test random pointer values!
+ \note This function may NOT be used to reliably test random pointer values!
     */
       return store().is_from(chunk);
     }
@@ -157,14 +163,21 @@
       (free)(chunk);
     }
 
- size_type get_next_size() const { return store().get_next_size(); }
- void set_next_size(const size_type x) { store().set_next_size(x); }
+ size_type get_next_size() const
+ { //! \returns next_size.
+ return store().get_next_size();
+ }
+ void set_next_size(const size_type x)
+ { //! Set new next_size.
+ //! \param x wanted next_size (!= 0).
+ store().set_next_size(x);
+ }
 };
 
 template <typename T, typename UserAllocator>
 object_pool<T, UserAllocator>::~object_pool()
 {
- // handle trivial case
+ // handle trivial case of invalid list.
   if (!this->list.valid())
     return;
 
@@ -181,35 +194,35 @@
     // increment next
     next = next.next();
 
- // delete all contained objects that aren't freed
+ // delete all contained objects that aren't freed.
 
- // Iterate 'i' through all chunks in the memory block
+ // Iterate 'i' through all chunks in the memory block.
     for (char * i = iter.begin(); i != iter.end(); i += partition_size)
     {
- // If this chunk is free
+ // If this chunk is free,
       if (i == freed_iter)
       {
- // Increment freed_iter to point to next in free list
+ // Increment freed_iter to point to next in free list.
         freed_iter = nextof(freed_iter);
 
- // Continue searching chunks in the memory block
+ // Continue searching chunks in the memory block.
         continue;
       }
 
- // This chunk is not free (allocated), so call its destructor
+ // This chunk is not free (allocated), so call its destructor,
       static_cast<T *>(static_cast<void *>(i))->~T();
- // and continue searching chunks in the memory block
+ // and continue searching chunks in the memory block.
     }
 
- // free storage
+ // free storage.
     (UserAllocator::free)(iter.begin());
 
- // increment iter
+ // increment iter.
     iter = next;
   } while (iter.valid());
 
   // Make the block list empty so that the inherited destructor doesn't try to
- // free it again.
+ // free it again.
   this->list.invalidate();
 }
 

Modified: sandbox/guild/pool/boost/pool/pool_alloc.hpp
==============================================================================
--- sandbox/guild/pool/boost/pool/pool_alloc.hpp (original)
+++ sandbox/guild/pool/boost/pool/pool_alloc.hpp 2011-02-25 11:36:02 EST (Fri, 25 Feb 2011)
@@ -1,4 +1,5 @@
 // Copyright (C) 2000, 2001 Stephen Cleary
+// Copyright (C) 2010 Paul A. Bristow added Doxygen comments.
 //
 // Distributed under the Boost Software License, Version 1.0. (See
 // accompanying file LICENSE_1_0.txt or copy at
@@ -27,15 +28,14 @@
   In addition, the fast_pool_allocator also provides an additional allocation
   and an additional deallocation function:
 
- Symbol Table\n
- Symbol Meaning\n
- PoolAlloc fast_pool_allocator<T, UserAllocator>\n
- p value of type T *\n
- \n
- Additional allocation/deallocation functions (fast_pool_allocator only)\n
- Expression Return Type Semantic Equivalence\n
- PoolAlloc::allocate() T * PoolAlloc::allocate(1)\n
- PoolAlloc::deallocate(p) void PoolAlloc::deallocate(p, 1)\n
+PoolAlloc fast_pool_allocator<T, UserAllocator>\n
+p value of type T *\n
+\n
+
+Additional allocation/deallocation functions (fast_pool_allocator only)\n
+Expression Return Type Semantic Equivalence\n
+PoolAlloc::allocate() T * PoolAlloc::allocate(1)\n
+PoolAlloc::deallocate(p) void PoolAlloc::deallocate(p, 1)\n
 
 The typedef user_allocator publishes the value of the UserAllocator template parameter.
 
@@ -68,9 +68,9 @@
 PoolAlloc will work around these libraries if it detects them;
 currently, workarounds are in place for:\n
 
-Borland C++ (Builder and command-line compiler) with default (RogueWave) library, ver. 5 and earlier\n
+Borland C++ (Builder and command-line compiler)
+with default (RogueWave) library, ver. 5 and earlier\n
 STLport (with any compiler), ver. 4.0 and earlier\n
-
 */
 
 // std::numeric_limits
@@ -117,29 +117,39 @@
 {
 };
 
-template <typename T, //! tparam T type of object to allocate/deallocate.
- typename UserAllocator, //!< Defines the method that the underlying Pool will use to allocate memory from the system. See User Allocators for details.
- typename Mutex, //!< Allows the user to determine the type of synchronization to be used on the underlying singleton pool. See the extensions to the public interface of singleton pool for more information.
- unsigned NextSize, //!< The value of this parameter is passed to the underlying Pool when it is created.
- unsigned MaxSize> //!< Limit on the maximum size used.
+/*! Allocate a pool of memory.
+ \tparam T type of object to allocate/deallocate.
+ \tparam UserAllocator. Defines the method that the underlying Pool will use to allocate memory from the system. See User Allocators for details.
+ \tparam Mutex Allows the user to determine the type of synchronization to be used on the underlying singleton pool. See the extensions to the public interface of singleton pool for more information.
+ \tparam NextSize The value of this parameter is passed to the underlying Pool when it is created.
+ \tparam MaxSize Limit on the maximum size used.
+*/
+template <typename T,
+ typename UserAllocator,
+ typename Mutex,
+ unsigned NextSize,
+ unsigned MaxSize >
+
 class pool_allocator
-{ //! Allocate a pool of memory.
+{
   public:
- typedef T value_type;
- typedef UserAllocator user_allocator;
- typedef Mutex mutex; //!< typedef mutex publishs the value of the template parameter Mutex.
- //!> BOOST_STATIC_CONSTANT static const value next_size publishes the values of the template parameter NextSize.
- BOOST_STATIC_CONSTANT(unsigned, next_size = NextSize);
+ typedef T value_type; //!< value_type of template parameter T.
+ typedef UserAllocator user_allocator; //!< allocator that defines the method that the underlying Pool will use to allocate memory from the system.
+ typedef Mutex mutex; //!< typedef mutex publishes the value of the template parameter Mutex.
+ BOOST_STATIC_CONSTANT(unsigned, next_size = NextSize); //!< next_size publishes the values of the template parameter NextSize.
 
- typedef value_type * pointer;
+ typedef value_type * pointer; //!<
     typedef const value_type * const_pointer;
     typedef value_type & reference;
     typedef const value_type & const_reference;
     typedef typename pool<UserAllocator>::size_type size_type;
     typedef typename pool<UserAllocator>::difference_type difference_type;
 
- template <typename U> //!\tparam U ???
- //! TODO explanation of use needed.
+ /*!
+ TODO explanation of use of rebind needed (and other places too).
+ \tparam U ???
+ */
+ template <typename U>
     struct rebind
     { //
       typedef pool_allocator<U, UserAllocator, Mutex, NextSize, MaxSize> other;
@@ -147,12 +157,13 @@
 
   public:
     pool_allocator()
- { //! Construction of default singleton_pool IFF an
- //! instance of this allocator is constructed during global initialization.
- // Required to ensure construction of singleton_pool IFF an
- // instance of this allocator is constructed during global
- // initialization. See ticket #2359 for a complete explanation
- // ( http://svn.boost.org/trac/boost/ticket/2359 )
+ { /*! Construction of default singleton_pool IFF an
+ instance of this allocator is constructed during global initialization.
+ Required to ensure construction of singleton_pool IFF an
+ instance of this allocator is constructed during global
+ initialization. See ticket #2359 for a complete explanation at
+ http://svn.boost.org/trac/boost/ticket/2359 .
+ */
       singleton_pool<pool_allocator_tag, sizeof(T), UserAllocator, Mutex,
                      NextSize, MaxSize>::is_from(0);
     }
@@ -164,11 +175,12 @@
     // not explicit, mimicking std::allocator [20.4.1]
     template <typename U>
     pool_allocator(const pool_allocator<U, UserAllocator, Mutex, NextSize, MaxSize> &)
- { //! Construction of singleton_pool using template U.
- // Required to ensure construction of singleton_pool IFF an
- // instance of this allocator is constructed during global
- // initialization. See ticket #2359 for a complete explaination
- // ( http://svn.boost.org/trac/boost/ticket/2359 )
+ { /*! Construction of singleton_pool using template U.
+ Required to ensure construction of singleton_pool IFF an
+ instance of this allocator is constructed during global
+ initialization. See ticket #2359 for a complete explanation
+ at http://svn.boost.org/trac/boost/ticket/2359 .
+ */
       singleton_pool<pool_allocator_tag, sizeof(T), UserAllocator, Mutex,
                      NextSize, MaxSize>::is_from(0);
     }
@@ -209,9 +221,15 @@
       return ret;
     }
     static pointer allocate(const size_type n, const void * const)
- { return allocate(n); }
+ { //! allocate n bytes
+ //! \param n bytes to allocate.
+ //! \param unused.
+ return allocate(n);
+ }
     static void deallocate(const pointer ptr, const size_type n)
- {
+ { //! Deallocate n bytes from ptr
+ //! \param ptr location to deallocate from.
+ //! \param n number of bytes to deallocate.
 #ifdef BOOST_POOL_INSTRUMENT
        debug_info<true>::allocated -= n * sizeof(T);
        std::cout << "Deallocating " << n << " * " << sizeof(T) << " bytes...\n"
@@ -226,7 +244,13 @@
     }
 };
 
-//! pool_allocator Pool memory allocator.
+/*! pool_allocator Pool Memory Allocator.
+
+ \tparam UserAllocator. Defines the method that the underlying Pool will use to allocate memory from the system. See User Allocators for details.
+ \tparam Mutex Allows the user to determine the type of synchronization to be used on the underlying singleton pool. See the extensions to the public interface of singleton pool for more information.
+ \tparam NextSize The value of this parameter is passed to the underlying Pool when it is created.
+ \tparam MaxSize Limit on the maximum size used.
+*/
 template<
     typename UserAllocator,
     typename Mutex,
@@ -239,8 +263,9 @@
     typedef const void* const_pointer;
     typedef void value_type;
     //! Need explanation of rebind. TODO.
+ //! \tparam U unknown tempalte parameter.
     template <class U> struct rebind
- { //! Rebind.
+ {
        typedef pool_allocator<U, UserAllocator, Mutex, NextSize, MaxSize> other;
     };
 };
@@ -251,21 +276,27 @@
 };
 
  /*! Fast Pool memory allocator.
-
- pool_allocator is a more general-purpose solution, geared towards
+ `pool_allocator` is a more general-purpose solution, geared towards
   efficiently servicing requests for any number of contiguous chunks.
- fast_pool_allocator is also a general-purpose solution,
+ `fast_pool_allocator` is also a general-purpose solution,
   but is geared towards efficiently servicing requests for one chunk at a time;
   it will work for contiguous chunks, but not as well as pool_allocator.
   If you are seriously concerned about performance,
   use fast_pool_allocator when dealing with containers such as std::list,
   and use pool_allocator when dealing with containers such as std::vector.
-*/
+
+ \tparam T type of object to allocate/deallocate.
+ \tparam UserAllocator. Defines the method that the underlying Pool will use to allocate memory from the system. See User Allocators for details.
+ \tparam Mutex Allows the user to determine the type of synchronization to be used on the underlying singleton pool. See the extensions to the public interface of singleton pool for more information.
+ \tparam NextSize The value of this parameter is passed to the underlying Pool when it is created.
+ \tparam MaxSize Limit on the maximum size used.
+ */
+
 template <typename T,
     typename UserAllocator,
     typename Mutex,
     unsigned NextSize,
- unsigned MaxSize>
+ unsigned MaxSize >
 class fast_pool_allocator
 {
   public:
@@ -281,7 +312,8 @@
     typedef typename pool<UserAllocator>::size_type size_type;
     typedef typename pool<UserAllocator>::difference_type difference_type;
 
- //! ??? TODO rebind description needed.
+ //! TODO rebind description needed.
+ //! \tparam U not known. TODO
     template <typename U>
     struct rebind
     {
@@ -293,8 +325,8 @@
     {
       // Required to ensure construction of singleton_pool IFF an
       // instace of this allocator is constructed during global
- // initialization. See ticket #2359 for a complete explaination
- // ( http://svn.boost.org/trac/boost/ticket/2359 )
+ // initialization. See ticket #2359 for a complete explanation
+ // at http://svn.boost.org/trac/boost/ticket/2359 .
       singleton_pool<fast_pool_allocator_tag, sizeof(T),
                      UserAllocator, Mutex, NextSize, MaxSize>::is_from(0);
     }
@@ -304,14 +336,26 @@
     // Default assignment operator used.
 
     // Not explicit, mimicking std::allocator [20.4.1]
+
+ /*! Allocate pool using fast method.
+
+ Required to ensure construction of singleton_pool IFF an
+ instance of this allocator is constructed during global
+ initialization. See ticket #2359 for a complete explanation
+ at http://svn.boost.org/trac/boost/ticket/2359 .
+
+ \tparam U not known. TODO
+
+ */
+
     template <typename U>
     fast_pool_allocator(
         const fast_pool_allocator<U, UserAllocator, Mutex, NextSize, MaxSize> &)
     {
       // Required to ensure construction of singleton_pool IFF an
       // instance of this allocator is constructed during global
- // initialization. See ticket #2359 for a complete explaination
- // ( http://svn.boost.org/trac/boost/ticket/2359 )
+ // initialization. See ticket #2359 for a complete explanation
+ // at http://svn.boost.org/trac/boost/ticket/2359 .
       singleton_pool<fast_pool_allocator_tag, sizeof(T),
                      UserAllocator, Mutex, NextSize, MaxSize>::is_from(0);
     }
@@ -319,7 +363,9 @@
     // Default destructor used.
 
     static pointer address(reference r)
- { return &r; }
+ {
+ return &r;
+ }
     static const_pointer address(const_reference s)
     { return &s; }
     static size_type max_size()
@@ -327,7 +373,7 @@
     void construct(const pointer ptr, const value_type & t)
     { new (ptr) T(t); }
     void destroy(const pointer ptr)
- {
+ { //! Destroy ptr using destructor.
       ptr->~T();
       (void) ptr; // Avoid unused variable warning.
     }
@@ -351,9 +397,11 @@
       return ret;
     }
     static pointer allocate(const size_type n, const void * const)
- { return allocate(n); }
+ { //! Allocate memory .
+ return allocate(n);
+ }
     static pointer allocate()
- {
+ { //! Allocate memory.
       const pointer ret = static_cast<pointer>(
           (singleton_pool<fast_pool_allocator_tag, sizeof(T),
               UserAllocator, Mutex, NextSize, MaxSize>::malloc)() );
@@ -362,7 +410,10 @@
       return ret;
     }
     static void deallocate(const pointer ptr, const size_type n)
- {
+ { //! Deallocate memory.
+ //! \param ptr TODO
+ //! \param n TODO.
+
 #ifdef BOOST_NO_PROPER_STL_DEALLOCATE
       if (ptr == 0 || n == 0)
         return;
@@ -375,26 +426,40 @@
             UserAllocator, Mutex, NextSize, MaxSize>::free)(ptr, n);
     }
     static void deallocate(const pointer ptr)
- {
+ { //! deallocate/free
       (singleton_pool<fast_pool_allocator_tag, sizeof(T),
           UserAllocator, Mutex, NextSize, MaxSize>::free)(ptr);
     }
 };
 
-//! Fast pool memory allocator.
+/*! fast_pool_allocator is a general-purpose solution but is geared towards efficiently servicing requests for one chunk at a
+ time; it will work for contiguous chunks, but not as well as pool_allocator.\n
+ If you are seriously concerned about performance, use
+ fast_pool_allocator when dealing with containers such as std::list, and use pool_allocator when dealing with containers
+ such as std::vector.
+
+ \tparam UserAllocator Defines the method that the underlying Pool will use to allocate memory from the system. See User Allocators for details.
+ \tparam Mutex Allows the user to determine the type of synchronization to be used on the underlying singleton pool. See the extensions to the public interface of singleton pool for more information.
+ \tparam NextSize The value of this parameter is passed to the underlying Pool when it is created.
+ \tparam MaxSize Limit on the maximum size used.
+*/
 template<
- typename UserAllocator, //!< Defines the method that the underlying Pool will use to allocate memory from the system. See User Allocators for details.
- typename Mutex, //!< Allows the user to determine the type of synchronization to be used on the underlying singleton pool. See the extensions to the public interface of singleton pool for more information.
- unsigned NextSize, //!< The value of this parameter is passed to the underlying Pool when it is created.
- unsigned MaxSize> //!< Limit on the maximum size used.
+ typename UserAllocator,
+ typename Mutex,
+ unsigned NextSize,
+ unsigned MaxSize >
 class fast_pool_allocator<void, UserAllocator, Mutex, NextSize, MaxSize>
 {
 public:
     typedef void* pointer;
     typedef const void* const_pointer;
     typedef void value_type;
- //! need explanation of rebind TODO.
- template <class U> struct rebind {
+
+ /*! rebind TODO need explanation of rebind as well.
+ \tparam U unknown template parameter
+ */
+ template <class U> struct rebind
+ {
         typedef fast_pool_allocator<U, UserAllocator, Mutex, NextSize, MaxSize> other;
     };
 };

Modified: sandbox/guild/pool/boost/pool/simple_segregated_storage.hpp
==============================================================================
--- sandbox/guild/pool/boost/pool/simple_segregated_storage.hpp (original)
+++ sandbox/guild/pool/boost/pool/simple_segregated_storage.hpp 2011-02-25 11:36:02 EST (Fri, 25 Feb 2011)
@@ -57,8 +57,8 @@
 
   protected:
     void * first; /*!< This data member is the free list.
- It points to the first chunk in the free list,
- or is equal to 0 if the free list is empty.
+ It points to the first chunk in the free list,
+ or is equal to 0 if the free list is empty.
     */
 
     //! \fn find_prev Traverses the free list referred to by "first",
@@ -84,8 +84,8 @@
     //! and then dereference and assign (*static_cast<void **>(first) = 0;).
     //! This can be done more easily through the use of this convenience function (nextof(first) = 0;).
     //! \returns dereferenced pointer.
- return *(static_cast<void **>(ptr));
- }
+ return *(static_cast<void **>(ptr));
+ }
 
   public:
     // Post: empty()
@@ -93,7 +93,7 @@
     :first(0)
     { //! Construct empty storage area.
       //! \post empty()
- }
+ }
 
     //! Segregate block into chunks.
     //! \pre npartition_sz >= sizeof(void *)
@@ -143,13 +143,12 @@
     // default destructor.
 
     bool empty() const
- { //! \returns true if simple_segregated_storage is empty.
- return (first == 0);
- }
+ { //! \returns true only if simple_segregated_storage is empty.
+ return (first == 0);
+ }
 
- // pre: !empty()
     void * malloc BOOST_PREVENT_MACRO_SUBSTITUTION()
- { //! Create a chunk
+ { //! Create a chunk.
       //! \pre !empty()
       //! Increment the "first" pointer to point to the next chunk.
       void * const ret = first;
@@ -159,31 +158,24 @@
       return ret;
     }
 
- // pre: chunk was previously returned from a malloc() referring to the
- // same free list
- // post: !empty()
     void free BOOST_PREVENT_MACRO_SUBSTITUTION(void * const chunk)
- { //! Freen a chunk.
+ { //! Free a chunk.
       //! \pre chunk was previously returned from a malloc() referring to the same free list.
       //! \post !empty()
       nextof(chunk) = first;
       first = chunk;
     }
 
- // pre: chunk was previously returned from a malloc() referring to the
- // same free list
- // post: !empty()
     void ordered_free(void * const chunk)
     { //! This (slower) implementation of 'free' places the memory
       //! back in the list in its proper order.
       //! \pre chunk was previously returned from a malloc() referring to the same free list
       //! \post !empty().
 
-
       // Find where "chunk" goes in the free list
       void * const loc = find_prev(chunk);
 
- // Place either at beginning or in middle/end
+ // Place either at beginning or in middle/end.
       if (loc == 0)
         (free)(chunk);
       else
@@ -193,23 +185,18 @@
       }
     }
 
- // Note: if you're allocating/deallocating n a lot, you should
- // be using an ordered pool.
- // pre: chunks was previously allocated from *this with the same
- // values for n and partition_size.
- // post: !empty()
    void * malloc_n(size_type n, size_type partition_size);
     //! \pre chunks was previously allocated from *this with the same
     //! values for n and partition_size.
     //! \post !empty()
- //! Note: if you're allocating/deallocating n a lot, you should
+ //! \note If you're allocating/deallocating n a lot, you should
     //! be using an ordered pool.
 
     void free_n(void * const chunks, const size_type n,
         const size_type partition_size)
     { //! Free N chunks.
       //! \pre chunks was previously allocated from *this with the same
- //! values for n and partition_size.
+ //! values for n and partition_size.
 
       if(n != 0)
         add_block(chunks, n * partition_size, partition_size);
@@ -220,9 +207,11 @@
     // post: !empty()
     void ordered_free_n(void * const chunks, const size_type n,
         const size_type partition_size)
- { //! Free n chunkcs from order list.
- //! \pre chunks was previously allocated from *this with the same
- //! values for n and partition_size.
+ { //! Free n chunks from order list.
+ //! \pre chunks was previously allocated from *this with the same
+ //! values for n and partition_size.
+
+ //! \pre n should not be zero (n == 0 has no effect).
 
       if(n != 0)
         add_ordered_block(chunks, n * partition_size, partition_size);
@@ -231,16 +220,21 @@
 
 template <typename SizeType>
 void * simple_segregated_storage<SizeType>::find_prev(void * const ptr)
-{
- // Handle border case
+{ /*!
+\returns location previous to where ptr would go if it was in the free list.
+\note This function finds the location previous to where ptr would go if it was in the free list.
+It does not find the entry in the free list before ptr
+(unless ptr is already in the free list).
+Specifically, find_prev(0) will return 0, not the last entry in the free list.
+*/
+ // Handle border case.
   if (first == 0 || std::greater<void *>()(first, ptr))
     return 0;
 
   void * iter = first;
   while (true)
   {
- // if we're about to hit the end or
- // if we've found where "ptr" goes
+ // if we're about to hit the end, or if we've found where "ptr" goes.
     if (nextof(iter) == 0 || std::greater<void *>()(nextof(iter), ptr))
       return iter;
 

Modified: sandbox/guild/pool/boost/pool/singleton_pool.hpp
==============================================================================
--- sandbox/guild/pool/boost/pool/singleton_pool.hpp (original)
+++ sandbox/guild/pool/boost/pool/singleton_pool.hpp 2011-02-25 11:36:02 EST (Fri, 25 Feb 2011)
@@ -14,7 +14,7 @@
   \brief Singleton_pool class allows other pool interfaces
   for types of the same size to share the same pool.
 
- /details singleton_pool.hpp provides a template class singleton_pool,
+ \details singleton_pool.hpp provides a template class singleton_pool,
   which provides access to a pool as a singleton object.\n
   For information on other pool-based interfaces, see the other pool interfaces.\n
 
@@ -45,55 +45,66 @@
 
 namespace boost {
 
- //! singleton pool class allows other pool interfaces
- //! for types of the same size to share the same pool.
- template <typename Tag, unsigned RequestedSize,
- typename UserAllocator, //!< User allocator, default = default_user_allocator_new_delete
- typename Mutex, //!< The typedef mutex publish the values of the template parameter Mutex (default details::pool::default_mutex).
- unsigned NextSize, //!< The typedef static const value next_size publish the values of the template parameter NextSize, (default 32).
- unsigned MaxSize> //!< Maximum size.
+ /*! singleton pool class allows other pool interfaces
+ for types of the same size to share the same pool.
+ \tparam Tag to allow different unbounded sets of singleton pools to exist.
+ \tparam RequestedSize Size of pool requested.
+ \tparam UserAllocator User allocator, default = default_user_allocator_new_delete
+ \tparam Mutex The typedef mutex publish the values of the template parameter Mutex (default details::pool::default_mutex).
+ \tparam NextSize The typedef static const value next_size publish the values of the template parameter NextSize, (default 32).
+ \tparam MaxSize Maximum size.
+ */
+
+ template <typename Tag,
+ unsigned RequestedSize,
+ typename UserAllocator,
+ typename Mutex,
+ unsigned NextSize,
+ unsigned MaxSize >
 struct singleton_pool
 {
   public:
     typedef Tag tag; /*!< The Tag template parameter allows
- different unbounded sets of singleton pools to exist.
- For example, the pool allocators use two tag classes to ensure that the
- two different allocator types never share the same underlying singleton pool.
- Tag is never actually used by singleton_pool.
- */
- typedef Mutex mutex;
- typedef UserAllocator user_allocator;
- typedef typename pool<UserAllocator>::size_type size_type;
- typedef typename pool<UserAllocator>::difference_type difference_type;
+ different unbounded sets of singleton pools to exist.
+ For example, the pool allocators use two tag classes to ensure that the
+ two different allocator types never share the same underlying singleton pool.
+ Tag is never actually used by singleton_pool.
+ */
+ typedef Mutex mutex; //!< Mutex is guard (default details::pool::default_mutex).
+ typedef UserAllocator user_allocator; //!< User allocator, default = default_user_allocator_new_delete.
+ typedef typename pool<UserAllocator>::size_type size_type; //!< size_type of user allocator.
+ typedef typename pool<UserAllocator>::difference_type difference_type; //!< difference_type of user allocator.
 
     BOOST_STATIC_CONSTANT(unsigned, requested_size = RequestedSize);
     BOOST_STATIC_CONSTANT(unsigned, next_size = NextSize);
 
   private:
- struct pool_type: Mutex
- { /*! Mutex This class is the type of mutex to use to protect
+ /*! Mutex class is the type of mutex to use to protect
        simultaneous access to the underlying Pool.
        It is exposed so that users may declare some singleton pools normally
        (i.e., with synchronization),
        but some singleton pools without synchronization
        (by specifying details::pool::null_mutex) for efficiency reasons.
       */
+ struct pool_type: Mutex
+ {
       pool<UserAllocator> p;
       pool_type()
       :
       p(RequestedSize, NextSize)
- { /*! Pool allocation.
- See The pair of functions size_type get_next_size() const; and void set_next_size(size_type);
+ {
+ /*! Pool allocation
+ See the pair of functions size_type get_next_size() const; and void set_next_size(size_type);
        that allow users to explicitly read and write the next_size value.
- This value is the number of chunks to request from the system
+ NextSize is the number of chunks to request from the system
        the next time that object needs to allocate system memory.
 
- param RequestedSize value of this parameter is passed to the underlying Pool when it is created.
- param NextSize value of this parameter is passed to the underlying Pool when it is created.
+ \param RequestedSize value of this parameter is passed to the underlying Pool when it is created.
+ \param NextSize value of this parameter is passed to the underlying Pool when it is created.
 
        \pre NextSize value should never be set to 0.
       */
- }
+ }
     }; // struct pool_type: Mutex
 
     typedef details::pool::singleton_default<pool_type> singleton;


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