Boost logo

Boost-Commit :

From: xushiweizh_at_[hidden]
Date: 2008-05-06 05:29:53


Author: xushiwei
Date: 2008-05-06 05:29:53 EDT (Tue, 06 May 2008)
New Revision: 45166
URL: http://svn.boost.org/trac/boost/changeset/45166

Log:
for vc6
Text files modified:
   sandbox/memory/boost/detail/performance_counter.hpp | 2 +-
   sandbox/memory/libs/memory/test/test_basic/memory/performance.cpp | 30 ++++++++++++++++++++----------
   sandbox/memory/libs/memory/test/test_basic/test.cpp | 4 +++-
   3 files changed, 24 insertions(+), 12 deletions(-)

Modified: sandbox/memory/boost/detail/performance_counter.hpp
==============================================================================
--- sandbox/memory/boost/detail/performance_counter.hpp (original)
+++ sandbox/memory/boost/detail/performance_counter.hpp 2008-05-06 05:29:53 EDT (Tue, 06 May 2008)
@@ -25,7 +25,7 @@
 // -------------------------------------------------------------------------
 
 template <class UIntT, class CharT>
-inline CharT* BOOST_DETAIL_CALL _ui2estr(const UIntT& val, CharT* estr)
+inline CharT* BOOST_DETAIL_CALL _ui2estr(UIntT val, CharT* estr)
 {
         *estr-- = '\0';
         do {

Modified: sandbox/memory/libs/memory/test/test_basic/memory/performance.cpp
==============================================================================
--- sandbox/memory/libs/memory/test/test_basic/memory/performance.cpp (original)
+++ sandbox/memory/libs/memory/test/test_basic/memory/performance.cpp 2008-05-06 05:29:53 EDT (Tue, 06 May 2008)
@@ -122,7 +122,7 @@
                                 boost::auto_alloc alloc;
                                 for (int i = 0; i < PerAlloc; ++i)
                                 {
- int* p = STD_NEW(alloc, int);
+ int* p = BOOST_NEW(alloc, int);
                                 }
                         }
                 }
@@ -139,7 +139,7 @@
                                 boost::scoped_alloc alloc;
                                 for (int i = 0; i < PerAlloc; ++i)
                                 {
- int* p = STD_NEW(alloc, int);
+ int* p = BOOST_NEW(alloc, int);
                                 }
                         }
                 }
@@ -156,7 +156,7 @@
                                 boost::scoped_alloc alloc(m_recycle);
                                 for (int i = 0; i < PerAlloc; ++i)
                                 {
- int* p = STD_NEW(alloc, int);
+ int* p = BOOST_NEW(alloc, int);
                                 }
                         }
                 }
@@ -170,45 +170,45 @@
                 const int PerAlloc = Total / NAlloc;
                 
                 m_acc.start();
- log.print(PerAlloc, "\n===== boost::auto_alloc(%d) =====\n");
+ log.trace("\n===== boost::auto_alloc(%d) =====\n", PerAlloc);
                 for (i = 0; i < Count; ++i)
                         doAutoAlloc(log, NAlloc, PerAlloc);
                 m_acc.trace_avg(log);
 
                 m_acc.start();
- log.print(PerAlloc, "\n===== TLS boost::scoped_alloc(%d) =====\n");
+ log.trace("\n===== TLS boost::scoped_alloc(%d) =====\n", PerAlloc);
                 for (i = 0; i < Count; ++i)
                         doTlsScopedAlloc(log, NAlloc, PerAlloc);
                 m_acc.trace_avg(log);
 
                 m_acc.start();
- log.print(PerAlloc, "\n===== boost::scoped_alloc(%d) =====\n");
+ log.trace("\n===== boost::scoped_alloc(%d) =====\n", PerAlloc);
                 for (i = 0; i < Count; ++i)
                         doScopedAlloc(log, NAlloc, PerAlloc);
                 m_acc.trace_avg(log);
 
 #if defined(__GNUG__)
                 m_acc.start();
- log.print(PerAlloc, "\n===== MtAllocator(%d) =====\n");
+ log.trace("\n===== MtAllocator(%d) =====\n", PerAlloc);
                 for (i = 0; i < Count; ++i)
                         doMtAllocator(log, NAlloc, PerAlloc);
                 m_acc.trace_avg(log);
 
                 m_acc.start();
- log.print(PerAlloc, "\n===== BoostPool(%d) =====\n");
+ log.trace("\n===== BoostPool(%d) =====\n", PerAlloc);
                 for (i = 0; i < Count; ++i)
                         doBoostPool(log, NAlloc, PerAlloc);
                 m_acc.trace_avg(log);
 
                 m_acc.start();
- log.print(PerAlloc, "\n===== BoostObjectPool(%d) =====\n");
+ log.trace("\n===== BoostObjectPool(%d) =====\n", PerAlloc);
                 for (i = 0; i < Count; ++i)
                         doBoostObjectPool(log, NAlloc, PerAlloc);
                 m_acc.trace_avg(log);
 #endif
 
                 m_acc.start();
- log.print(PerAlloc, "\n===== NewDelete(%d) =====\n");
+ log.trace("\n===== NewDelete(%d) =====\n", PerAlloc);
                 for (i = 0; i < Count; ++i)
                         doNewDelete(log, NAlloc, PerAlloc);
                 m_acc.trace_avg(log);
@@ -230,5 +230,15 @@
 };
 
 // -------------------------------------------------------------------------
+
+void testPerformance()
+{
+ typedef NS_BOOST_DETAIL::stdout_log LogT;
+ LogT log;
+ TestAllocatorPerformance<LogT> test;
+ test.testComparison(log);
+}
+
+// -------------------------------------------------------------------------
 // $Log: performance.cpp,v $
 //

Modified: sandbox/memory/libs/memory/test/test_basic/test.cpp
==============================================================================
--- sandbox/memory/libs/memory/test/test_basic/test.cpp (original)
+++ sandbox/memory/libs/memory/test/test_basic/test.cpp 2008-05-06 05:29:53 EDT (Tue, 06 May 2008)
@@ -13,12 +13,14 @@
 #include <boost/memory.hpp>
 #include <boost/memory/linklib.hpp>
 
+void testPerformance();
 void testStlContainers();
 void simpleExamples();
 
 int main()
 {
- simpleExamples();
+ testPerformance();
+// simpleExamples();
 // testStlContainers();
         return 0;
 }


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