Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r58471 - in sandbox/fiber: boost/fiber libs/fiber/src
From: oliver.kowalke_at_[hidden]
Date: 2009-12-20 15:52:25


Author: olli
Date: 2009-12-20 15:52:25 EST (Sun, 20 Dec 2009)
New Revision: 58471
URL: http://svn.boost.org/trac/boost/changeset/58471

Log:
- default stacksize now a static var

Text files modified:
   sandbox/fiber/boost/fiber/fiber.hpp | 12 +++++-------
   sandbox/fiber/libs/fiber/src/fiber.cpp | 3 +++
   2 files changed, 8 insertions(+), 7 deletions(-)

Modified: sandbox/fiber/boost/fiber/fiber.hpp
==============================================================================
--- sandbox/fiber/boost/fiber/fiber.hpp (original)
+++ sandbox/fiber/boost/fiber/fiber.hpp 2009-12-20 15:52:25 EST (Sun, 20 Dec 2009)
@@ -31,8 +31,6 @@
 namespace boost {
 namespace fibers {
 
-#define BOOST_FIBER_DEFAULT_STACKSIZE 64000
-
 template< typename Strategy >
 class scheduler;
 class strategy;
@@ -47,6 +45,8 @@
         static void convert_thread_to_fiber();
         static void convert_fiber_to_thread();
 
+ static std::size_t default_stacksize;
+
         BOOST_COPYABLE_AND_MOVABLE( fiber);
 
         detail::info_base::ptr_t info_base_;
@@ -82,7 +82,7 @@
 
         template< typename Fn >
         explicit fiber( Fn fn) :
- info_base_( make_info_( BOOST_FIBER_DEFAULT_STACKSIZE, fn) )
+ info_base_( make_info_( default_stacksize, fn) )
         { init_(); }
 
         template< typename Fn >
@@ -99,7 +99,7 @@
         fiber( Fn fn, BOOST_ENUM_FIBER_ARGS(n)) : \
                 info_base_( \
                         make_info_( \
- BOOST_FIBER_DEFAULT_STACKSIZE, \
+ default_stacksize, \
                                 boost::bind( boost::type< void >(), fn, BOOST_PP_ENUM_PARAMS(n, a)) ) ) \
         { init_(); } \
         \
@@ -121,7 +121,7 @@
 
         template< typename Fn >
         explicit fiber( BOOST_RV_REF( Fn) fn) :
- info_base_( make_info_( BOOST_FIBER_DEFAULT_STACKSIZE, fn) )
+ info_base_( make_info_( default_stacksize, fn) )
         { init_(); }
 
         template< typename Fn >
@@ -234,8 +234,6 @@
 #undef BOOST_FIBER_ARG
 #undef BOOST_FIBER_MAX_ARITY
 
-#undef BOOST_FIBER_DEFAULT_STACKSIZE
-
 }
 
 using fibers::fiber;

Modified: sandbox/fiber/libs/fiber/src/fiber.cpp
==============================================================================
--- sandbox/fiber/libs/fiber/src/fiber.cpp (original)
+++ sandbox/fiber/libs/fiber/src/fiber.cpp 2009-12-20 15:52:25 EST (Sun, 20 Dec 2009)
@@ -18,6 +18,9 @@
 namespace boost {
 namespace fibers {
 
+std::size_t
+fiber::default_stacksize = 64000;
+
 fiber::fiber() :
         info_base_()
 {}


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