Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r54252 - in sandbox/monotonic: boost/monotonic libs/monotonic/test
From: christian.schladetsch_at_[hidden]
Date: 2009-06-22 23:06:57


Author: cschladetsch
Date: 2009-06-22 23:06:56 EDT (Mon, 22 Jun 2009)
New Revision: 54252
URL: http://svn.boost.org/trac/boost/changeset/54252

Log:
removed region_allocator<>, added regions to allocator<>
Text files modified:
   sandbox/monotonic/boost/monotonic/allocator.hpp | 22 +++++++++++-----------
   sandbox/monotonic/boost/monotonic/forward_declarations.hpp | 15 ++++++++-------
   sandbox/monotonic/libs/monotonic/test/compare_memory_pool.cpp | 1 +
   sandbox/monotonic/libs/monotonic/test/monotonic.vcproj | 4 ----
   4 files changed, 20 insertions(+), 22 deletions(-)

Modified: sandbox/monotonic/boost/monotonic/allocator.hpp
==============================================================================
--- sandbox/monotonic/boost/monotonic/allocator.hpp (original)
+++ sandbox/monotonic/boost/monotonic/allocator.hpp 2009-06-22 23:06:56 EDT (Mon, 22 Jun 2009)
@@ -12,8 +12,8 @@
 {
         namespace monotonic
         {
- template <>
- struct allocator<void>
+ template <class Region>
+ struct allocator<void, Region>
                 {
                         typedef void* pointer;
                         typedef const void* const_pointer;
@@ -22,14 +22,14 @@
                         template <class U>
                         struct rebind
                         {
- typedef allocator<U> other;
+ typedef allocator<U, Region> other;
                         };
                 };
 
- template <class T>
- struct allocator : allocator_base<T, allocator<T> >
+ template <class T, class Region>
+ struct allocator : allocator_base<T, allocator<T, Region> >
                 {
- typedef allocator_base<T, allocator<T> > Parent;
+ typedef allocator_base<T, allocator<T, Region> > Parent;
                         using typename Parent::size_type;
                         using typename Parent::difference_type;
                         using typename Parent::pointer;
@@ -41,7 +41,7 @@
                         template <class U>
                         struct rebind
                         {
- typedef allocator<U> other;
+ typedef allocator<U, Region> other;
                         };
 
                         allocator() throw()
@@ -58,16 +58,16 @@
                         allocator(const allocator& alloc) throw()
                                 : Parent(alloc) { }
 
- template <class U>
- allocator(const allocator<U> &alloc) throw()
+ template <class U, class OtherRegion>
+ allocator(const allocator<U, OtherRegion> &alloc) throw()
                                 : Parent(alloc) { }
 
- friend bool operator==(allocator<T> const &A, allocator<T> const &B)
+ friend bool operator==(allocator<T,Region> const &A, allocator<T,Region> const &B)
                         {
                                 return static_cast<Parent const &>(A) == static_cast<Parent const &>(B);
                         }
 
- friend bool operator!=(allocator<T> const &A, allocator<T> const &B)
+ friend bool operator!=(allocator<T,Region> const &A, allocator<T,Region> const &B)
                         {
                                 return static_cast<Parent const &>(A) != static_cast<Parent const &>(B);
                         }

Modified: sandbox/monotonic/boost/monotonic/forward_declarations.hpp
==============================================================================
--- sandbox/monotonic/boost/monotonic/forward_declarations.hpp (original)
+++ sandbox/monotonic/boost/monotonic/forward_declarations.hpp 2009-06-22 23:06:56 EDT (Mon, 22 Jun 2009)
@@ -37,6 +37,7 @@
                 struct shared_region_tag { };
                 struct thread_local_region_tag { };
 
+ /// a RIIA structure for setting and resetting the global storage pointer
                 template <class Region, class Storage = storage<> >
                 struct local;
 
@@ -68,22 +69,22 @@
 
                 /// a monotonic allocator has a storage buffer and a no-op deallocate() method
                 /// default to use static_storage_base<..., storage>
- template <class>
+ template <class T, class Region = default_region_tag>
                 struct allocator;
 
- /// a monotonic region allocator uses a specified storage. Each region uses independent
- /// storage that may be used and reset.
- template <class T, class Region = default_region_tag>
- struct region_allocator;
+ ///// a monotonic region allocator uses a specified storage. Each region uses independent
+ ///// storage that may be used and reset.
+ //template <class T, class Region = default_region_tag>
+ //struct region_allocator;
 
                 /// a monotonic shared_allocator has a shared storage buffer and a no-op deallocate() method
                 /// defaults to use static_storage_base<..., shared_storage>
- template <class>
+ template <class T, class Region = shared_region_tag>
                 struct shared_allocator;
         
                 /// a monotonic local_allocator has a shared storage buffer and a no-op deallocate() method
                 /// defaults to use static_storage_base<..., thread_local_storage>
- template <class>
+ template <class T, class Region = thread_local_region_tag>
                 struct local_allocator;
 
         } // namespace monotonic

Modified: sandbox/monotonic/libs/monotonic/test/compare_memory_pool.cpp
==============================================================================
--- sandbox/monotonic/libs/monotonic/test/compare_memory_pool.cpp (original)
+++ sandbox/monotonic/libs/monotonic/test/compare_memory_pool.cpp 2009-06-22 23:06:56 EDT (Mon, 22 Jun 2009)
@@ -26,6 +26,7 @@
 using namespace std;
 using namespace boost;
 
+/// region tag for local storage used in run_test
 struct local_tag {};
 
 template <class Fun>

Modified: sandbox/monotonic/libs/monotonic/test/monotonic.vcproj
==============================================================================
--- sandbox/monotonic/libs/monotonic/test/monotonic.vcproj (original)
+++ sandbox/monotonic/libs/monotonic/test/monotonic.vcproj 2009-06-22 23:06:56 EDT (Mon, 22 Jun 2009)
@@ -291,10 +291,6 @@
>
                                 </File>
                                 <File
- RelativePath="..\..\..\boost\monotonic\region_allocator.hpp"
- >
- </File>
- <File
                                         RelativePath="..\..\..\boost\monotonic\shared_allocator.hpp"
>
                                 </File>


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