Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r54289 - in sandbox/monotonic: boost/monotonic libs/monotonic/test/Tests
From: christian.schladetsch_at_[hidden]
Date: 2009-06-23 16:46:01


Author: cschladetsch
Date: 2009-06-23 16:46:00 EDT (Tue, 23 Jun 2009)
New Revision: 54289
URL: http://svn.boost.org/trac/boost/changeset/54289

Log:
changed comments

Text files modified:
   sandbox/monotonic/boost/monotonic/fixed_storage.hpp | 7 -------
   sandbox/monotonic/boost/monotonic/forward_declarations.hpp | 5 -----
   sandbox/monotonic/boost/monotonic/local.hpp | 4 +++-
   sandbox/monotonic/libs/monotonic/test/Tests/tests.cpp | 27 +++++++++++++++------------
   4 files changed, 18 insertions(+), 25 deletions(-)

Modified: sandbox/monotonic/boost/monotonic/fixed_storage.hpp
==============================================================================
--- sandbox/monotonic/boost/monotonic/fixed_storage.hpp (original)
+++ sandbox/monotonic/boost/monotonic/fixed_storage.hpp 2009-06-23 16:46:00 EDT (Tue, 23 Jun 2009)
@@ -92,13 +92,6 @@
                         /// allocate storage, given alignment requirement
                         void *allocate(size_t num_bytes, size_t /*alignment*/)
                         {
- if (0)
- {
- void *ptr = &buffer[cursor];
- cursor += 64;
- return ptr;
- }
-
 #ifdef BOOST_MONOTONIC_STORAGE_EARLY_OUT
                                 if (full)
                                         return 0;

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-23 16:46:00 EDT (Tue, 23 Jun 2009)
@@ -49,11 +49,6 @@
                 }
         
                 /// a RIIA structure for accessing and releasing storage
- //template <size_t N = DefaultSizes::InlineSize
- // , class Region = default_region_tag
- // , size_t M = DefaultSizes::MinHeapIncrement
- // , class Access = default_access_tag
- // , class Al = std::allocator<void> >
                 template <class Region = default_region_tag, class Access = default_access_tag>
                 struct local;
 

Modified: sandbox/monotonic/boost/monotonic/local.hpp
==============================================================================
--- sandbox/monotonic/boost/monotonic/local.hpp (original)
+++ sandbox/monotonic/boost/monotonic/local.hpp 2009-06-23 16:46:00 EDT (Tue, 23 Jun 2009)
@@ -16,8 +16,9 @@
                 template <class Region, class Access>
                 struct local
                 {
- typedef local<Region,Access> This;
+ typedef local<Region, Access> This;
 
+ /// the storage to use
                         typedef static_storage<
                                 Region
                                 , Access
@@ -25,6 +26,7 @@
                                 , DefaultSizes::MinHeapIncrement
                                 , default_allocator > StaticStorage;
 
+ /// create a rebounded allocator type
                         template <class T>
                         struct allocator
                         {

Modified: sandbox/monotonic/libs/monotonic/test/Tests/tests.cpp
==============================================================================
--- sandbox/monotonic/libs/monotonic/test/Tests/tests.cpp (original)
+++ sandbox/monotonic/libs/monotonic/test/Tests/tests.cpp 2009-06-23 16:46:00 EDT (Tue, 23 Jun 2009)
@@ -151,22 +151,25 @@
         }
 }
 
+struct region0 {};
+struct region1 {};
+
 BOOST_AUTO_TEST_CASE(test_shared_allocation)
 {
- typedef std::list<int, monotonic::allocator<int, region0, monotonic::shared_access_tag> > List0;
- List0 list0;
-
- typedef std::list<int, monotonic::allocator<int, region0, monotonic::thread_local_access_tag> > List1;
- List1 list1;
+ // use default region and access
+ std::list<int, monotonic::allocator<int> > list;
 
- // same thing
- typedef std::list<int, monotonic::shared_allocator<int, region0> > List2;
- List2 list2;
-
- // same again
- typedef monotonic::list<int, region0, monotonic::shared_access_tag> List3;
- List3 list3;
+ // use specific region and access
+ std::list<int, monotonic::allocator<int, region0, monotonic::shared_access_tag> > list;
+ std::list<int, monotonic::allocator<int, region0, monotonic::thread_local_access_tag> > list;
+
+ // using wrapped container
+ monotonic::list<int> list;
+ monotonic::list<int, region0, monotonic::shared_access_tag> list;
+ monotonic::list<int, region0, monotonic::thread_local_access_tag> list;
 
+ // use different regions
+ monotonic::map<int, monotonic::list<monotonic::string, region1>, region0> map;
 }
 
 BOOST_AUTO_TEST_CASE(test_regional_allocation)


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