Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r54175 - in sandbox/monotonic/boost/monotonic: . detail
From: christian.schladetsch_at_[hidden]
Date: 2009-06-21 23:36:15


Author: cschladetsch
Date: 2009-06-21 23:36:14 EDT (Sun, 21 Jun 2009)
New Revision: 54175
URL: http://svn.boost.org/trac/boost/changeset/54175

Log:
changed pool::allocate to take a reference

Text files modified:
   sandbox/monotonic/boost/monotonic/detail/pool.hpp | 8 ++++----
   sandbox/monotonic/boost/monotonic/storage.hpp | 2 +-
   2 files changed, 5 insertions(+), 5 deletions(-)

Modified: sandbox/monotonic/boost/monotonic/detail/pool.hpp
==============================================================================
--- sandbox/monotonic/boost/monotonic/detail/pool.hpp (original)
+++ sandbox/monotonic/boost/monotonic/detail/pool.hpp 2009-06-21 23:36:14 EDT (Sun, 21 Jun 2009)
@@ -24,7 +24,7 @@
                                 {
                                 }
                                 template <class Storage>
- void *allocate(Storage *storage)
+ void *allocate(Storage &storage)
                                 {
                                         if (next == last)
                                                 expand(storage);
@@ -33,13 +33,13 @@
                                         return ptr;
                                 }
                                 template <class Storage>
- void expand(Storage *storage)
+ void expand(Storage &storage)
                                 {
                                         size_t capacity = std::max(DefaultSizes::MinPoolSize*bucket_size, (last - first)*bucket_size*2);
- void *ptr = storage->from_fixed(capacity, 16);
+ void *ptr = storage.from_fixed(capacity, 16);
                                         if (ptr == 0)
                                         {
- ptr = storage->from_heap(capacity, 16);
+ ptr = storage.from_heap(capacity, 16);
                                         }
                                         first = next = (char *)ptr;
                                         last = first + capacity;

Modified: sandbox/monotonic/boost/monotonic/storage.hpp
==============================================================================
--- sandbox/monotonic/boost/monotonic/storage.hpp (original)
+++ sandbox/monotonic/boost/monotonic/storage.hpp 2009-06-21 23:36:14 EDT (Sun, 21 Jun 2009)
@@ -102,7 +102,7 @@
                                 size_t bucket_num = (ChunkSize + num_bytes) >> ChunkShift;
                                 if (bucket_num >= NumPools)
                                         return 0;
- return pools[bucket_num].allocate(this);
+ return pools[bucket_num].allocate(*this);
                         }
                         
                         void *from_fixed(size_t num_bytes, size_t alignment)


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