summaryrefslogtreecommitdiff
path: root/boost/coroutine
diff options
context:
space:
mode:
authorLorry Tar Creator <lorry-tar-importer@baserock.org>2014-10-31 14:41:14 +0000
committer <>2014-12-12 16:07:56 +0000
commited232fdd34968697a68783b3195b1da4226915b5 (patch)
tree7a7053ceb8874b28ec4b868d4c49b500008a102e /boost/coroutine
parent1c3648bf5b7d17fcd4fe9bc95802b16fd9eee304 (diff)
downloadboost-tarball-ed232fdd34968697a68783b3195b1da4226915b5.tar.gz
Imported from /home/lorry/working-area/delta_boost-tarball/boost_1_57_0.tar.bz2.boost_1_57_0
Diffstat (limited to 'boost/coroutine')
-rw-r--r--boost/coroutine/asymmetric_coroutine.hpp98
-rw-r--r--boost/coroutine/detail/pull_coroutine_impl.hpp16
-rw-r--r--boost/coroutine/detail/pull_coroutine_object.hpp6
-rw-r--r--boost/coroutine/detail/pull_coroutine_synthesized.hpp2
-rw-r--r--boost/coroutine/detail/push_coroutine_impl.hpp16
-rw-r--r--boost/coroutine/detail/push_coroutine_object.hpp6
-rw-r--r--boost/coroutine/detail/push_coroutine_synthesized.hpp2
-rw-r--r--boost/coroutine/detail/setup.hpp4
-rw-r--r--boost/coroutine/detail/symmetric_coroutine_call.hpp34
-rw-r--r--boost/coroutine/detail/symmetric_coroutine_impl.hpp18
-rw-r--r--boost/coroutine/detail/symmetric_coroutine_object.hpp6
-rw-r--r--boost/coroutine/detail/symmetric_coroutine_yield.hpp6
-rw-r--r--boost/coroutine/posix/protected_stack_allocator.hpp10
-rw-r--r--boost/coroutine/stack_context.hpp12
-rw-r--r--boost/coroutine/standard_stack_allocator.hpp11
15 files changed, 127 insertions, 120 deletions
diff --git a/boost/coroutine/asymmetric_coroutine.hpp b/boost/coroutine/asymmetric_coroutine.hpp
index 38ad3ab93..ff4684f61 100644
--- a/boost/coroutine/asymmetric_coroutine.hpp
+++ b/boost/coroutine/asymmetric_coroutine.hpp
@@ -394,11 +394,11 @@ public:
}
}
- push_coroutine( BOOST_RV_REF( push_coroutine) other) BOOST_NOEXCEPT :
+ inline push_coroutine( BOOST_RV_REF( push_coroutine) other) BOOST_NOEXCEPT :
impl_( 0)
{ swap( other); }
- push_coroutine & operator=( BOOST_RV_REF( push_coroutine) other) BOOST_NOEXCEPT
+ inline push_coroutine & operator=( BOOST_RV_REF( push_coroutine) other) BOOST_NOEXCEPT
{
push_coroutine tmp( boost::move( other) );
swap( tmp);
@@ -407,13 +407,13 @@ public:
BOOST_EXPLICIT_OPERATOR_BOOL();
- bool operator!() const BOOST_NOEXCEPT
+ inline bool operator!() const BOOST_NOEXCEPT
{ return 0 == impl_ || impl_->is_complete(); }
- void swap( push_coroutine & other) BOOST_NOEXCEPT
+ inline void swap( push_coroutine & other) BOOST_NOEXCEPT
{ std::swap( impl_, other.impl_); }
- push_coroutine & operator()()
+ inline push_coroutine & operator()()
{
BOOST_ASSERT( * this);
@@ -479,7 +479,7 @@ public:
BOOST_ASSERT( 0 < internal_stack_ctx.size);
// placement new for internal coroutine
impl_ = new ( internal_stack_ctx.sp) object_t(
- forward< coroutine_fn >( fn), attrs, stack_ctx, internal_stack_ctx, stack_alloc);
+ boost::forward< coroutine_fn >( fn), attrs, stack_ctx, internal_stack_ctx, stack_alloc);
BOOST_ASSERT( impl_);
impl_->pull();
}
@@ -507,7 +507,7 @@ public:
BOOST_ASSERT( 0 < internal_stack_ctx.size);
// placement new for internal coroutine
impl_ = new ( internal_stack_ctx.sp) object_t(
- forward< coroutine_fn >( fn), attrs, stack_ctx, internal_stack_ctx, stack_alloc);
+ boost::forward< coroutine_fn >( fn), attrs, stack_ctx, internal_stack_ctx, stack_alloc);
BOOST_ASSERT( impl_);
impl_->pull();
}
@@ -535,7 +535,7 @@ public:
BOOST_ASSERT( 0 < internal_stack_ctx.size);
// placement new for internal coroutine
impl_ = new ( internal_stack_ctx.sp) object_t(
- forward< Fn >( fn), attrs, stack_ctx, internal_stack_ctx, stack_alloc);
+ boost::forward< Fn >( fn), attrs, stack_ctx, internal_stack_ctx, stack_alloc);
BOOST_ASSERT( impl_);
impl_->pull();
}
@@ -563,7 +563,7 @@ public:
BOOST_ASSERT( 0 < internal_stack_ctx.size);
// placement new for internal coroutine
impl_ = new ( internal_stack_ctx.sp) object_t(
- forward< Fn >( fn), attrs, stack_ctx, internal_stack_ctx, stack_alloc);
+ boost::forward< Fn >( fn), attrs, stack_ctx, internal_stack_ctx, stack_alloc);
BOOST_ASSERT( impl_);
impl_->pull();
}
@@ -869,7 +869,7 @@ public:
BOOST_ASSERT( 0 < internal_stack_ctx.size);
// placement new for internal coroutine
impl_ = new ( internal_stack_ctx.sp) object_t(
- forward< coroutine_fn >( fn), attrs, stack_ctx, internal_stack_ctx, stack_alloc);
+ boost::forward< coroutine_fn >( fn), attrs, stack_ctx, internal_stack_ctx, stack_alloc);
BOOST_ASSERT( impl_);
impl_->pull();
}
@@ -897,7 +897,7 @@ public:
BOOST_ASSERT( 0 < internal_stack_ctx.size);
// placement new for internal coroutine
impl_ = new ( internal_stack_ctx.sp) object_t(
- forward< coroutine_fn >( fn), attrs, stack_ctx, internal_stack_ctx, stack_alloc);
+ boost::forward< coroutine_fn >( fn), attrs, stack_ctx, internal_stack_ctx, stack_alloc);
BOOST_ASSERT( impl_);
impl_->pull();
}
@@ -925,7 +925,7 @@ public:
BOOST_ASSERT( 0 < internal_stack_ctx.size);
// placement new for internal coroutine
impl_ = new ( internal_stack_ctx.sp) object_t(
- forward< Fn >( fn), attrs, stack_ctx, internal_stack_ctx, stack_alloc);
+ boost::forward< Fn >( fn), attrs, stack_ctx, internal_stack_ctx, stack_alloc);
BOOST_ASSERT( impl_);
impl_->pull();
}
@@ -953,7 +953,7 @@ public:
BOOST_ASSERT( 0 < internal_stack_ctx.size);
// placement new for internal coroutine
impl_ = new ( internal_stack_ctx.sp) object_t(
- forward< Fn >( fn), attrs, stack_ctx, internal_stack_ctx, stack_alloc);
+ boost::forward< Fn >( fn), attrs, stack_ctx, internal_stack_ctx, stack_alloc);
BOOST_ASSERT( impl_);
impl_->pull();
}
@@ -1255,7 +1255,7 @@ public:
BOOST_ASSERT( 0 < internal_stack_ctx.size);
// placement new for internal coroutine
impl_ = new ( internal_stack_ctx.sp) object_t(
- forward< coroutine_fn >( fn), attrs, stack_ctx, internal_stack_ctx, stack_alloc);
+ boost::forward< coroutine_fn >( fn), attrs, stack_ctx, internal_stack_ctx, stack_alloc);
BOOST_ASSERT( impl_);
impl_->pull();
}
@@ -1283,7 +1283,7 @@ public:
BOOST_ASSERT( 0 < internal_stack_ctx.size);
// placement new for internal coroutine
impl_ = new ( internal_stack_ctx.sp) object_t(
- forward< coroutine_fn >( fn), attrs, stack_ctx, internal_stack_ctx, stack_alloc);
+ boost::forward< coroutine_fn >( fn), attrs, stack_ctx, internal_stack_ctx, stack_alloc);
BOOST_ASSERT( impl_);
impl_->pull();
}
@@ -1311,7 +1311,7 @@ public:
BOOST_ASSERT( 0 < internal_stack_ctx.size);
// placement new for internal coroutine
impl_ = new ( internal_stack_ctx.sp) object_t(
- forward< Fn >( fn), attrs, stack_ctx, internal_stack_ctx, stack_alloc);
+ boost::forward< Fn >( fn), attrs, stack_ctx, internal_stack_ctx, stack_alloc);
BOOST_ASSERT( impl_);
impl_->pull();
}
@@ -1339,7 +1339,7 @@ public:
BOOST_ASSERT( 0 < internal_stack_ctx.size);
// placement new for internal coroutine
impl_ = new ( internal_stack_ctx.sp) object_t(
- forward< Fn >( fn), attrs, stack_ctx, internal_stack_ctx, stack_alloc);
+ boost::forward< Fn >( fn), attrs, stack_ctx, internal_stack_ctx, stack_alloc);
BOOST_ASSERT( impl_);
impl_->pull();
}
@@ -1466,11 +1466,11 @@ public:
}
}
- pull_coroutine( BOOST_RV_REF( pull_coroutine) other) BOOST_NOEXCEPT :
+ inline pull_coroutine( BOOST_RV_REF( pull_coroutine) other) BOOST_NOEXCEPT :
impl_( 0)
{ swap( other); }
- pull_coroutine & operator=( BOOST_RV_REF( pull_coroutine) other) BOOST_NOEXCEPT
+ inline pull_coroutine & operator=( BOOST_RV_REF( pull_coroutine) other) BOOST_NOEXCEPT
{
pull_coroutine tmp( boost::move( other) );
swap( tmp);
@@ -1479,13 +1479,13 @@ public:
BOOST_EXPLICIT_OPERATOR_BOOL();
- bool operator!() const BOOST_NOEXCEPT
+ inline bool operator!() const BOOST_NOEXCEPT
{ return 0 == impl_ || impl_->is_complete(); }
- void swap( pull_coroutine & other) BOOST_NOEXCEPT
+ inline void swap( pull_coroutine & other) BOOST_NOEXCEPT
{ std::swap( impl_, other.impl_); }
- pull_coroutine & operator()()
+ inline pull_coroutine & operator()()
{
BOOST_ASSERT( * this);
@@ -1522,7 +1522,7 @@ push_coroutine< Arg >::push_coroutine( coroutine_fn fn,
BOOST_ASSERT( 0 < internal_stack_ctx.size);
// placement new for internal coroutine
impl_ = new ( internal_stack_ctx.sp) object_t(
- forward< coroutine_fn >( fn), attrs, stack_ctx, internal_stack_ctx, stack_alloc);
+ boost::forward< coroutine_fn >( fn), attrs, stack_ctx, internal_stack_ctx, stack_alloc);
BOOST_ASSERT( impl_);
}
@@ -1550,7 +1550,7 @@ push_coroutine< Arg >::push_coroutine( coroutine_fn fn,
BOOST_ASSERT( 0 < internal_stack_ctx.size);
// placement new for internal coroutine
impl_ = new ( internal_stack_ctx.sp) object_t(
- forward< coroutine_fn >( fn), attrs, stack_ctx, internal_stack_ctx, stack_alloc);
+ boost::forward< coroutine_fn >( fn), attrs, stack_ctx, internal_stack_ctx, stack_alloc);
BOOST_ASSERT( impl_);
}
@@ -1577,7 +1577,7 @@ push_coroutine< Arg & >::push_coroutine( coroutine_fn fn,
BOOST_ASSERT( 0 < internal_stack_ctx.size);
// placement new for internal coroutine
impl_ = new ( internal_stack_ctx.sp) object_t(
- forward< coroutine_fn >( fn), attrs, stack_ctx, internal_stack_ctx, stack_alloc);
+ boost::forward< coroutine_fn >( fn), attrs, stack_ctx, internal_stack_ctx, stack_alloc);
BOOST_ASSERT( impl_);
}
@@ -1605,12 +1605,12 @@ push_coroutine< Arg & >::push_coroutine( coroutine_fn fn,
BOOST_ASSERT( 0 < internal_stack_ctx.size);
// placement new for internal coroutine
impl_ = new ( internal_stack_ctx.sp) object_t(
- forward< coroutine_fn >( fn), attrs, stack_ctx, internal_stack_ctx, stack_alloc);
+ boost::forward< coroutine_fn >( fn), attrs, stack_ctx, internal_stack_ctx, stack_alloc);
BOOST_ASSERT( impl_);
}
-push_coroutine< void >::push_coroutine( coroutine_fn fn,
- attributes const& attrs) :
+inline push_coroutine< void >::push_coroutine( coroutine_fn fn,
+ attributes const& attrs) :
impl_( 0)
{
// create a stack-context
@@ -1631,7 +1631,7 @@ push_coroutine< void >::push_coroutine( coroutine_fn fn,
BOOST_ASSERT( 0 < internal_stack_ctx.size);
// placement new for internal coroutine
impl_ = new ( internal_stack_ctx.sp) object_t(
- forward< coroutine_fn >( fn), attrs, stack_ctx, internal_stack_ctx, stack_alloc);
+ boost::forward< coroutine_fn >( fn), attrs, stack_ctx, internal_stack_ctx, stack_alloc);
BOOST_ASSERT( impl_);
}
@@ -1658,7 +1658,7 @@ push_coroutine< void >::push_coroutine( coroutine_fn fn,
BOOST_ASSERT( 0 < internal_stack_ctx.size);
// placement new for internal coroutine
impl_ = new ( internal_stack_ctx.sp) object_t(
- forward< coroutine_fn >( fn), attrs, stack_ctx, internal_stack_ctx, stack_alloc);
+ boost::forward< coroutine_fn >( fn), attrs, stack_ctx, internal_stack_ctx, stack_alloc);
BOOST_ASSERT( impl_);
}
# endif
@@ -1686,7 +1686,7 @@ push_coroutine< Arg >::push_coroutine( BOOST_RV_REF( Fn) fn,
BOOST_ASSERT( 0 < internal_stack_ctx.size);
// placement new for internal coroutine
impl_ = new ( internal_stack_ctx.sp) object_t(
- forward< Fn >( fn), attrs, stack_ctx, internal_stack_ctx, stack_alloc);
+ boost::forward< Fn >( fn), attrs, stack_ctx, internal_stack_ctx, stack_alloc);
BOOST_ASSERT( impl_);
}
@@ -1714,7 +1714,7 @@ push_coroutine< Arg >::push_coroutine( BOOST_RV_REF( Fn) fn,
BOOST_ASSERT( 0 < internal_stack_ctx.size);
// placement new for internal coroutine
impl_ = new ( internal_stack_ctx.sp) object_t(
- forward< Fn >( fn), attrs, stack_ctx, internal_stack_ctx, stack_alloc);
+ boost::forward< Fn >( fn), attrs, stack_ctx, internal_stack_ctx, stack_alloc);
BOOST_ASSERT( impl_);
}
@@ -1742,7 +1742,7 @@ push_coroutine< Arg & >::push_coroutine( BOOST_RV_REF( Fn) fn,
BOOST_ASSERT( 0 < internal_stack_ctx.size);
// placement new for internal coroutine
impl_ = new ( internal_stack_ctx.sp) object_t(
- forward< Fn >( fn), attrs, stack_ctx, internal_stack_ctx, stack_alloc);
+ boost::forward< Fn >( fn), attrs, stack_ctx, internal_stack_ctx, stack_alloc);
BOOST_ASSERT( impl_);
}
@@ -1770,7 +1770,7 @@ push_coroutine< Arg & >::push_coroutine( BOOST_RV_REF( Fn) fn,
BOOST_ASSERT( 0 < internal_stack_ctx.size);
// placement new for internal coroutine
impl_ = new ( internal_stack_ctx.sp) object_t(
- forward< Fn >( fn), attrs, stack_ctx, internal_stack_ctx, stack_alloc);
+ boost::forward< Fn >( fn), attrs, stack_ctx, internal_stack_ctx, stack_alloc);
BOOST_ASSERT( impl_);
}
@@ -1797,7 +1797,7 @@ push_coroutine< void >::push_coroutine( BOOST_RV_REF( Fn) fn,
BOOST_ASSERT( 0 < internal_stack_ctx.size);
// placement new for internal coroutine
impl_ = new ( internal_stack_ctx.sp) object_t(
- forward< Fn >( fn), attrs, stack_ctx, internal_stack_ctx, stack_alloc);
+ boost::forward< Fn >( fn), attrs, stack_ctx, internal_stack_ctx, stack_alloc);
BOOST_ASSERT( impl_);
}
@@ -1824,7 +1824,7 @@ push_coroutine< void >::push_coroutine( BOOST_RV_REF( Fn) fn,
BOOST_ASSERT( 0 < internal_stack_ctx.size);
// placement new for internal coroutine
impl_ = new ( internal_stack_ctx.sp) object_t(
- forward< Fn >( fn), attrs, stack_ctx, internal_stack_ctx, stack_alloc);
+ boost::forward< Fn >( fn), attrs, stack_ctx, internal_stack_ctx, stack_alloc);
BOOST_ASSERT( impl_);
}
#else
@@ -2204,7 +2204,6 @@ struct coroutine
typedef pull_coroutine< T > pull_type;
};
-#if defined(__clang__)
template< typename R >
typename pull_coroutine< R >::iterator
begin( pull_coroutine< R > & c)
@@ -2224,7 +2223,6 @@ template< typename R >
typename push_coroutine< R >::iterator
end( push_coroutine< R > & c)
{ return boost::end( c); }
-#endif
}
@@ -2238,30 +2236,6 @@ struct range_mutable_iterator< coroutines::pull_coroutine< R > >
}
-namespace std {
-
-template< typename R >
-typename boost::coroutines::pull_coroutine< R >::iterator
-begin( boost::coroutines::pull_coroutine< R > & c)
-{ return boost::begin( c); }
-
-template< typename R >
-typename boost::coroutines::pull_coroutine< R >::iterator
-end( boost::coroutines::pull_coroutine< R > & c)
-{ return boost::end( c); }
-
-template< typename R >
-typename boost::coroutines::push_coroutine< R >::iterator
-begin( boost::coroutines::push_coroutine< R > & c)
-{ return boost::begin( c); }
-
-template< typename R >
-typename boost::coroutines::push_coroutine< R >::iterator
-end( boost::coroutines::push_coroutine< R > & c)
-{ return boost::end( c); }
-
-}
-
#ifdef BOOST_HAS_ABI_HEADERS
# include BOOST_ABI_SUFFIX
#endif
diff --git a/boost/coroutine/detail/pull_coroutine_impl.hpp b/boost/coroutine/detail/pull_coroutine_impl.hpp
index 97a18bf00..10ca59754 100644
--- a/boost/coroutine/detail/pull_coroutine_impl.hpp
+++ b/boost/coroutine/detail/pull_coroutine_impl.hpp
@@ -291,25 +291,25 @@ public:
virtual ~pull_coroutine_impl() {}
- bool force_unwind() const BOOST_NOEXCEPT
+ inline bool force_unwind() const BOOST_NOEXCEPT
{ return 0 != ( flags_ & flag_force_unwind); }
- bool unwind_requested() const BOOST_NOEXCEPT
+ inline bool unwind_requested() const BOOST_NOEXCEPT
{ return 0 != ( flags_ & flag_unwind_stack); }
- bool preserve_fpu() const BOOST_NOEXCEPT
+ inline bool preserve_fpu() const BOOST_NOEXCEPT
{ return 0 != ( flags_ & flag_preserve_fpu); }
- bool is_started() const BOOST_NOEXCEPT
+ inline bool is_started() const BOOST_NOEXCEPT
{ return 0 != ( flags_ & flag_started); }
- bool is_running() const BOOST_NOEXCEPT
+ inline bool is_running() const BOOST_NOEXCEPT
{ return 0 != ( flags_ & flag_running); }
- bool is_complete() const BOOST_NOEXCEPT
+ inline bool is_complete() const BOOST_NOEXCEPT
{ return 0 != ( flags_ & flag_complete); }
- void unwind_stack() BOOST_NOEXCEPT
+ inline void unwind_stack() BOOST_NOEXCEPT
{
if ( is_started() && ! is_complete() && force_unwind() )
{
@@ -325,7 +325,7 @@ public:
}
}
- void pull()
+ inline void pull()
{
BOOST_ASSERT( ! is_running() );
BOOST_ASSERT( ! is_complete() );
diff --git a/boost/coroutine/detail/pull_coroutine_object.hpp b/boost/coroutine/detail/pull_coroutine_object.hpp
index acc9a570a..cfe34bd3c 100644
--- a/boost/coroutine/detail/pull_coroutine_object.hpp
+++ b/boost/coroutine/detail/pull_coroutine_object.hpp
@@ -98,7 +98,7 @@ public:
#ifdef BOOST_NO_CXX11_RVALUE_REFERENCES
fn_( fn),
#else
- fn_( forward< Fn >( fn) ),
+ fn_( boost::forward< Fn >( fn) ),
#endif
stack_ctx_( stack_ctx),
stack_alloc_( stack_alloc)
@@ -186,7 +186,7 @@ public:
#ifdef BOOST_NO_CXX11_RVALUE_REFERENCES
fn_( fn),
#else
- fn_( forward< Fn >( fn) ),
+ fn_( boost::forward< Fn >( fn) ),
#endif
stack_ctx_( stack_ctx),
stack_alloc_( stack_alloc)
@@ -274,7 +274,7 @@ public:
#ifdef BOOST_NO_CXX11_RVALUE_REFERENCES
fn_( fn),
#else
- fn_( forward< Fn >( fn) ),
+ fn_( boost::forward< Fn >( fn) ),
#endif
stack_ctx_( stack_ctx),
stack_alloc_( stack_alloc)
diff --git a/boost/coroutine/detail/pull_coroutine_synthesized.hpp b/boost/coroutine/detail/pull_coroutine_synthesized.hpp
index 1736c86a9..952d50c11 100644
--- a/boost/coroutine/detail/pull_coroutine_synthesized.hpp
+++ b/boost/coroutine/detail/pull_coroutine_synthesized.hpp
@@ -68,7 +68,7 @@ public:
impl_t( caller, callee, unwind, preserve_fpu)
{}
- void destroy() {}
+ inline void destroy() {}
};
}}}
diff --git a/boost/coroutine/detail/push_coroutine_impl.hpp b/boost/coroutine/detail/push_coroutine_impl.hpp
index da052fc4e..8ee2bd6f0 100644
--- a/boost/coroutine/detail/push_coroutine_impl.hpp
+++ b/boost/coroutine/detail/push_coroutine_impl.hpp
@@ -231,25 +231,25 @@ public:
if ( preserve_fpu) flags_ |= flag_preserve_fpu;
}
- bool force_unwind() const BOOST_NOEXCEPT
+ inline bool force_unwind() const BOOST_NOEXCEPT
{ return 0 != ( flags_ & flag_force_unwind); }
- bool unwind_requested() const BOOST_NOEXCEPT
+ inline bool unwind_requested() const BOOST_NOEXCEPT
{ return 0 != ( flags_ & flag_unwind_stack); }
- bool preserve_fpu() const BOOST_NOEXCEPT
+ inline bool preserve_fpu() const BOOST_NOEXCEPT
{ return 0 != ( flags_ & flag_preserve_fpu); }
- bool is_started() const BOOST_NOEXCEPT
+ inline bool is_started() const BOOST_NOEXCEPT
{ return 0 != ( flags_ & flag_started); }
- bool is_running() const BOOST_NOEXCEPT
+ inline bool is_running() const BOOST_NOEXCEPT
{ return 0 != ( flags_ & flag_running); }
- bool is_complete() const BOOST_NOEXCEPT
+ inline bool is_complete() const BOOST_NOEXCEPT
{ return 0 != ( flags_ & flag_complete); }
- void unwind_stack() BOOST_NOEXCEPT
+ inline void unwind_stack() BOOST_NOEXCEPT
{
if ( is_started() && ! is_complete() && force_unwind() )
{
@@ -265,7 +265,7 @@ public:
}
}
- void push()
+ inline void push()
{
BOOST_ASSERT( ! is_running() );
BOOST_ASSERT( ! is_complete() );
diff --git a/boost/coroutine/detail/push_coroutine_object.hpp b/boost/coroutine/detail/push_coroutine_object.hpp
index 1a0aa7e3d..1a39c0723 100644
--- a/boost/coroutine/detail/push_coroutine_object.hpp
+++ b/boost/coroutine/detail/push_coroutine_object.hpp
@@ -110,7 +110,7 @@ public:
#ifdef BOOST_NO_CXX11_RVALUE_REFERENCES
fn_( fn),
#else
- fn_( forward< Fn >( fn) ),
+ fn_( boost::forward< Fn >( fn) ),
#endif
stack_ctx_( stack_ctx),
stack_alloc_( stack_alloc)
@@ -198,7 +198,7 @@ public:
#ifdef BOOST_NO_CXX11_RVALUE_REFERENCES
fn_( fn),
#else
- fn_( forward< Fn >( fn) ),
+ fn_( boost::forward< Fn >( fn) ),
#endif
stack_ctx_( stack_ctx),
stack_alloc_( stack_alloc)
@@ -286,7 +286,7 @@ public:
#ifdef BOOST_NO_CXX11_RVALUE_REFERENCES
fn_( fn),
#else
- fn_( forward< Fn >( fn) ),
+ fn_( boost::forward< Fn >( fn) ),
#endif
stack_ctx_( stack_ctx),
stack_alloc_( stack_alloc)
diff --git a/boost/coroutine/detail/push_coroutine_synthesized.hpp b/boost/coroutine/detail/push_coroutine_synthesized.hpp
index ac79a7634..306a841fc 100644
--- a/boost/coroutine/detail/push_coroutine_synthesized.hpp
+++ b/boost/coroutine/detail/push_coroutine_synthesized.hpp
@@ -66,7 +66,7 @@ public:
impl_t( caller, callee, unwind, preserve_fpu)
{}
- void destroy() {}
+ inline void destroy() {}
};
}}}
diff --git a/boost/coroutine/detail/setup.hpp b/boost/coroutine/detail/setup.hpp
index a776029e7..35f601a77 100644
--- a/boost/coroutine/detail/setup.hpp
+++ b/boost/coroutine/detail/setup.hpp
@@ -41,7 +41,7 @@ struct setup
coroutine_context * caller_,
coroutine_context * callee_,
attributes const& attr_) :
- fn( forward< Fn >( fn_) ),
+ fn( boost::forward< Fn >( fn_) ),
caller( caller_),
callee( callee_),
attr( attr_)
@@ -58,7 +58,7 @@ struct setup
#ifdef BOOST_NO_CXX11_RVALUE_REFERENCES
fn( fn_),
#else
- fn( forward< Fn >( fn_) ),
+ fn( boost::forward< Fn >( fn_) ),
#endif
caller( caller_),
callee( callee_),
diff --git a/boost/coroutine/detail/symmetric_coroutine_call.hpp b/boost/coroutine/detail/symmetric_coroutine_call.hpp
index 8a6702a39..a49927563 100644
--- a/boost/coroutine/detail/symmetric_coroutine_call.hpp
+++ b/boost/coroutine/detail/symmetric_coroutine_call.hpp
@@ -75,7 +75,7 @@ public:
BOOST_ASSERT( 0 < internal_stack_ctx.size);
// placement new for internal coroutine
impl_ = new ( internal_stack_ctx.sp) object_t(
- forward< coroutine_fn >( fn), attrs, stack_ctx, internal_stack_ctx, stack_alloc);
+ boost::forward< coroutine_fn >( fn), attrs, stack_ctx, internal_stack_ctx, stack_alloc);
BOOST_ASSERT( impl_);
}
@@ -100,7 +100,7 @@ public:
BOOST_ASSERT( 0 < internal_stack_ctx.size);
// placement new for internal coroutine
impl_ = new ( internal_stack_ctx.sp) object_t(
- forward< coroutine_fn >( fn), attrs, stack_ctx, internal_stack_ctx, stack_alloc);
+ boost::forward< coroutine_fn >( fn), attrs, stack_ctx, internal_stack_ctx, stack_alloc);
BOOST_ASSERT( impl_);
}
# endif
@@ -125,7 +125,7 @@ public:
BOOST_ASSERT( 0 < internal_stack_ctx.size);
// placement new for internal coroutine
impl_ = new ( internal_stack_ctx.sp) object_t(
- forward< Fn >( fn), attrs, stack_ctx, internal_stack_ctx, stack_alloc);
+ boost::forward< Fn >( fn), attrs, stack_ctx, internal_stack_ctx, stack_alloc);
BOOST_ASSERT( impl_);
}
@@ -150,7 +150,7 @@ public:
BOOST_ASSERT( 0 < internal_stack_ctx.size);
// placement new for internal coroutine
impl_ = new ( internal_stack_ctx.sp) object_t(
- forward< Fn >( fn), attrs, stack_ctx, internal_stack_ctx, stack_alloc);
+ boost::forward< Fn >( fn), attrs, stack_ctx, internal_stack_ctx, stack_alloc);
BOOST_ASSERT( impl_);
}
#else
@@ -335,7 +335,7 @@ public:
BOOST_ASSERT( 0 < internal_stack_ctx.size);
// placement new for internal coroutine
impl_ = new ( internal_stack_ctx.sp) object_t(
- forward< coroutine_fn >( fn), attrs, stack_ctx, internal_stack_ctx, stack_alloc);
+ boost::forward< coroutine_fn >( fn), attrs, stack_ctx, internal_stack_ctx, stack_alloc);
BOOST_ASSERT( impl_);
}
@@ -360,7 +360,7 @@ public:
BOOST_ASSERT( 0 < internal_stack_ctx.size);
// placement new for internal coroutine
impl_ = new ( internal_stack_ctx.sp) object_t(
- forward< coroutine_fn >( fn), attrs, stack_ctx, internal_stack_ctx, stack_alloc);
+ boost::forward< coroutine_fn >( fn), attrs, stack_ctx, internal_stack_ctx, stack_alloc);
BOOST_ASSERT( impl_);
}
# endif
@@ -385,7 +385,7 @@ public:
BOOST_ASSERT( 0 < internal_stack_ctx.size);
// placement new for internal coroutine
impl_ = new ( internal_stack_ctx.sp) object_t(
- forward< Fn >( fn), attrs, stack_ctx, internal_stack_ctx, stack_alloc);
+ boost::forward< Fn >( fn), attrs, stack_ctx, internal_stack_ctx, stack_alloc);
BOOST_ASSERT( impl_);
}
@@ -410,7 +410,7 @@ public:
BOOST_ASSERT( 0 < internal_stack_ctx.size);
// placement new for internal coroutine
impl_ = new ( internal_stack_ctx.sp) object_t(
- forward< Fn >( fn), attrs, stack_ctx, internal_stack_ctx, stack_alloc);
+ boost::forward< Fn >( fn), attrs, stack_ctx, internal_stack_ctx, stack_alloc);
BOOST_ASSERT( impl_);
}
#else
@@ -595,7 +595,7 @@ public:
BOOST_ASSERT( 0 < internal_stack_ctx.size);
// placement new for internal coroutine
impl_ = new ( internal_stack_ctx.sp) object_t(
- forward< coroutine_fn >( fn), attrs, stack_ctx, internal_stack_ctx, stack_alloc);
+ boost::forward< coroutine_fn >( fn), attrs, stack_ctx, internal_stack_ctx, stack_alloc);
BOOST_ASSERT( impl_);
}
@@ -620,7 +620,7 @@ public:
BOOST_ASSERT( 0 < internal_stack_ctx.size);
// placement new for internal coroutine
impl_ = new ( internal_stack_ctx.sp) object_t(
- forward< coroutine_fn >( fn), attrs, stack_ctx, internal_stack_ctx, stack_alloc);
+ boost::forward< coroutine_fn >( fn), attrs, stack_ctx, internal_stack_ctx, stack_alloc);
BOOST_ASSERT( impl_);
}
# endif
@@ -645,7 +645,7 @@ public:
BOOST_ASSERT( 0 < internal_stack_ctx.size);
// placement new for internal coroutine
impl_ = new ( internal_stack_ctx.sp) object_t(
- forward< Fn >( fn), attrs, stack_ctx, internal_stack_ctx, stack_alloc);
+ boost::forward< Fn >( fn), attrs, stack_ctx, internal_stack_ctx, stack_alloc);
BOOST_ASSERT( impl_);
}
@@ -670,7 +670,7 @@ public:
BOOST_ASSERT( 0 < internal_stack_ctx.size);
// placement new for internal coroutine
impl_ = new ( internal_stack_ctx.sp) object_t(
- forward< Fn >( fn), attrs, stack_ctx, internal_stack_ctx, stack_alloc);
+ boost::forward< Fn >( fn), attrs, stack_ctx, internal_stack_ctx, stack_alloc);
BOOST_ASSERT( impl_);
}
#else
@@ -780,11 +780,11 @@ public:
}
}
- symmetric_coroutine_call( BOOST_RV_REF( symmetric_coroutine_call) other) BOOST_NOEXCEPT :
+ inline symmetric_coroutine_call( BOOST_RV_REF( symmetric_coroutine_call) other) BOOST_NOEXCEPT :
impl_( 0)
{ swap( other); }
- symmetric_coroutine_call & operator=( BOOST_RV_REF( symmetric_coroutine_call) other) BOOST_NOEXCEPT
+ inline symmetric_coroutine_call & operator=( BOOST_RV_REF( symmetric_coroutine_call) other) BOOST_NOEXCEPT
{
symmetric_coroutine_call tmp( boost::move( other) );
swap( tmp);
@@ -793,13 +793,13 @@ public:
BOOST_EXPLICIT_OPERATOR_BOOL();
- bool operator!() const BOOST_NOEXCEPT
+ inline bool operator!() const BOOST_NOEXCEPT
{ return 0 == impl_ || impl_->is_complete() || impl_->is_running(); }
- void swap( symmetric_coroutine_call & other) BOOST_NOEXCEPT
+ inline void swap( symmetric_coroutine_call & other) BOOST_NOEXCEPT
{ std::swap( impl_, other.impl_); }
- symmetric_coroutine_call & operator()() BOOST_NOEXCEPT
+ inline symmetric_coroutine_call & operator()() BOOST_NOEXCEPT
{
BOOST_ASSERT( * this);
diff --git a/boost/coroutine/detail/symmetric_coroutine_impl.hpp b/boost/coroutine/detail/symmetric_coroutine_impl.hpp
index 5a1e0529c..0234ca776 100644
--- a/boost/coroutine/detail/symmetric_coroutine_impl.hpp
+++ b/boost/coroutine/detail/symmetric_coroutine_impl.hpp
@@ -342,25 +342,25 @@ public:
virtual ~symmetric_coroutine_impl() {}
- bool force_unwind() const BOOST_NOEXCEPT
+ inline bool force_unwind() const BOOST_NOEXCEPT
{ return 0 != ( flags_ & flag_force_unwind); }
- bool unwind_requested() const BOOST_NOEXCEPT
+ inline bool unwind_requested() const BOOST_NOEXCEPT
{ return 0 != ( flags_ & flag_unwind_stack); }
- bool preserve_fpu() const BOOST_NOEXCEPT
+ inline bool preserve_fpu() const BOOST_NOEXCEPT
{ return 0 != ( flags_ & flag_preserve_fpu); }
- bool is_started() const BOOST_NOEXCEPT
+ inline bool is_started() const BOOST_NOEXCEPT
{ return 0 != ( flags_ & flag_started); }
- bool is_running() const BOOST_NOEXCEPT
+ inline bool is_running() const BOOST_NOEXCEPT
{ return 0 != ( flags_ & flag_running); }
- bool is_complete() const BOOST_NOEXCEPT
+ inline bool is_complete() const BOOST_NOEXCEPT
{ return 0 != ( flags_ & flag_complete); }
- void unwind_stack() BOOST_NOEXCEPT
+ inline void unwind_stack() BOOST_NOEXCEPT
{
if ( is_started() && ! is_complete() && force_unwind() )
{
@@ -378,7 +378,7 @@ public:
}
}
- void resume() BOOST_NOEXCEPT
+ inline void resume() BOOST_NOEXCEPT
{
BOOST_ASSERT( ! is_running() );
BOOST_ASSERT( ! is_complete() );
@@ -392,7 +392,7 @@ public:
flags_ &= ~flag_running;
}
- void yield() BOOST_NOEXCEPT
+ inline void yield() BOOST_NOEXCEPT
{
BOOST_ASSERT( is_running() );
BOOST_ASSERT( ! is_complete() );
diff --git a/boost/coroutine/detail/symmetric_coroutine_object.hpp b/boost/coroutine/detail/symmetric_coroutine_object.hpp
index c7516f9cc..a1c0c052a 100644
--- a/boost/coroutine/detail/symmetric_coroutine_object.hpp
+++ b/boost/coroutine/detail/symmetric_coroutine_object.hpp
@@ -74,7 +74,7 @@ public:
#ifdef BOOST_NO_CXX11_RVALUE_REFERENCES
fn_( fn),
#else
- fn_( forward< Fn >( fn) ),
+ fn_( boost::forward< Fn >( fn) ),
#endif
stack_ctx_( stack_ctx),
stack_alloc_( stack_alloc)
@@ -155,7 +155,7 @@ public:
#ifdef BOOST_NO_CXX11_RVALUE_REFERENCES
fn_( fn),
#else
- fn_( forward< Fn >( fn) ),
+ fn_( boost::forward< Fn >( fn) ),
#endif
stack_ctx_( stack_ctx),
stack_alloc_( stack_alloc)
@@ -236,7 +236,7 @@ public:
#ifdef BOOST_NO_CXX11_RVALUE_REFERENCES
fn_( fn),
#else
- fn_( forward< Fn >( fn) ),
+ fn_( boost::forward< Fn >( fn) ),
#endif
stack_ctx_( stack_ctx),
stack_alloc_( stack_alloc)
diff --git a/boost/coroutine/detail/symmetric_coroutine_yield.hpp b/boost/coroutine/detail/symmetric_coroutine_yield.hpp
index c357d9e94..296676b6f 100644
--- a/boost/coroutine/detail/symmetric_coroutine_yield.hpp
+++ b/boost/coroutine/detail/symmetric_coroutine_yield.hpp
@@ -255,13 +255,13 @@ public:
BOOST_EXPLICIT_OPERATOR_BOOL();
- bool operator!() const BOOST_NOEXCEPT
+ inline bool operator!() const BOOST_NOEXCEPT
{ return 0 == impl_; }
- void swap( symmetric_coroutine_yield & other) BOOST_NOEXCEPT
+ inline void swap( symmetric_coroutine_yield & other) BOOST_NOEXCEPT
{ std::swap( impl_, other.impl_); }
- symmetric_coroutine_yield & operator()()
+ inline symmetric_coroutine_yield & operator()()
{
impl_->yield();
return * this;
diff --git a/boost/coroutine/posix/protected_stack_allocator.hpp b/boost/coroutine/posix/protected_stack_allocator.hpp
index f9b153d4a..659de337a 100644
--- a/boost/coroutine/posix/protected_stack_allocator.hpp
+++ b/boost/coroutine/posix/protected_stack_allocator.hpp
@@ -14,6 +14,10 @@ extern "C" {
#include <unistd.h>
}
+#if defined(BOOST_USE_VALGRIND)
+#include <valgrind/valgrind.h>
+#endif
+
#include <cmath>
#include <cstddef>
#include <new>
@@ -70,6 +74,9 @@ struct basic_protected_stack_allocator
ctx.size = size_;
ctx.sp = static_cast< char * >( limit) + ctx.size;
+#if defined(BOOST_USE_VALGRIND)
+ ctx.valgrind_stack_id = VALGRIND_STACK_REGISTER( ctx.sp, limit);
+#endif
}
void deallocate( stack_context & ctx)
@@ -78,6 +85,9 @@ struct basic_protected_stack_allocator
BOOST_ASSERT( traits_type::minimum_size() <= ctx.size);
BOOST_ASSERT( traits_type::is_unbounded() || ( traits_type::maximum_size() >= ctx.size) );
+#if defined(BOOST_USE_VALGRIND)
+ VALGRIND_STACK_DEREGISTER( ctx.valgrind_stack_id);
+#endif
void * limit = static_cast< char * >( ctx.sp) - ctx.size;
// conform to POSIX.4 (POSIX.1b-1993, _POSIX_C_SOURCE=199309L)
::munmap( limit, ctx.size);
diff --git a/boost/coroutine/stack_context.hpp b/boost/coroutine/stack_context.hpp
index 53344e30f..1ca11eb4a 100644
--- a/boost/coroutine/stack_context.hpp
+++ b/boost/coroutine/stack_context.hpp
@@ -28,9 +28,15 @@ struct stack_context
std::size_t size;
void * sp;
segments_context segments_ctx;
+#if defined(BOOST_USE_VALGRIND)
+ unsigned valgrind_stack_id;
+#endif
stack_context() :
size( 0), sp( 0), segments_ctx()
+#if defined(BOOST_USE_VALGRIND)
+ , valgrind_stack_id( 0)
+#endif
{}
};
#else
@@ -38,9 +44,15 @@ struct stack_context
{
std::size_t size;
void * sp;
+#if defined(BOOST_USE_VALGRIND)
+ unsigned valgrind_stack_id;
+#endif
stack_context() :
size( 0), sp( 0)
+#if defined(BOOST_USE_VALGRIND)
+ , valgrind_stack_id( 0)
+#endif
{}
};
#endif
diff --git a/boost/coroutine/standard_stack_allocator.hpp b/boost/coroutine/standard_stack_allocator.hpp
index 3341ce3ec..b946fffc4 100644
--- a/boost/coroutine/standard_stack_allocator.hpp
+++ b/boost/coroutine/standard_stack_allocator.hpp
@@ -7,6 +7,10 @@
#ifndef BOOST_COROUTINES_STANDARD_STACK_ALLOCATOR_H
#define BOOST_COROUTINES_STANDARD_STACK_ALLOCATOR_H
+#if defined(BOOST_USE_VALGRIND)
+#include <valgrind/valgrind.h>
+#endif
+
#include <cstddef>
#include <cstdlib>
#include <new>
@@ -40,6 +44,9 @@ struct basic_standard_stack_allocator
ctx.size = size;
ctx.sp = static_cast< char * >( limit) + ctx.size;
+#if defined(BOOST_USE_VALGRIND)
+ ctx.valgrind_stack_id = VALGRIND_STACK_REGISTER( ctx.sp, limit);
+#endif
}
void deallocate( stack_context & ctx)
@@ -48,6 +55,10 @@ struct basic_standard_stack_allocator
BOOST_ASSERT( traits_type::minimum_size() <= ctx.size);
BOOST_ASSERT( traits_type::is_unbounded() || ( traits_type::maximum_size() >= ctx.size) );
+#if defined(BOOST_USE_VALGRIND)
+ VALGRIND_STACK_DEREGISTER( ctx.valgrind_stack_id);
+#endif
+
void * limit = static_cast< char * >( ctx.sp) - ctx.size;
std::free( limit);
}