summaryrefslogtreecommitdiff
path: root/boost/coroutine/detail/symmetric_coroutine_impl.hpp
diff options
context:
space:
mode:
Diffstat (limited to 'boost/coroutine/detail/symmetric_coroutine_impl.hpp')
-rw-r--r--boost/coroutine/detail/symmetric_coroutine_impl.hpp66
1 files changed, 21 insertions, 45 deletions
diff --git a/boost/coroutine/detail/symmetric_coroutine_impl.hpp b/boost/coroutine/detail/symmetric_coroutine_impl.hpp
index 96d948a49c..b4066d8f78 100644
--- a/boost/coroutine/detail/symmetric_coroutine_impl.hpp
+++ b/boost/coroutine/detail/symmetric_coroutine_impl.hpp
@@ -36,13 +36,12 @@ public:
typedef parameters< R > param_type;
symmetric_coroutine_impl( preallocated const& palloc,
- bool unwind, bool preserve_fpu) BOOST_NOEXCEPT :
+ bool unwind) BOOST_NOEXCEPT :
flags_( 0),
caller_(),
callee_( trampoline< symmetric_coroutine_impl< R > >, palloc)
{
if ( unwind) flags_ |= flag_force_unwind;
- if ( preserve_fpu) flags_ |= flag_preserve_fpu;
}
virtual ~symmetric_coroutine_impl() {}
@@ -53,9 +52,6 @@ public:
bool unwind_requested() const BOOST_NOEXCEPT
{ return 0 != ( flags_ & flag_unwind_stack); }
- bool preserve_fpu() const BOOST_NOEXCEPT
- { return 0 != ( flags_ & flag_preserve_fpu); }
-
bool is_started() const BOOST_NOEXCEPT
{ return 0 != ( flags_ & flag_started); }
@@ -74,8 +70,7 @@ public:
param_type to( unwind_t::force_unwind);
caller_.jump(
callee_,
- reinterpret_cast< intptr_t >( & to),
- preserve_fpu() );
+ & to);
flags_ &= ~flag_running;
flags_ &= ~flag_unwind_stack;
@@ -97,11 +92,10 @@ public:
flags_ &= ~flag_running;
param_type to;
param_type * from(
- reinterpret_cast< param_type * >(
+ static_cast< param_type * >(
callee_.jump(
caller_,
- reinterpret_cast< intptr_t >( & to),
- preserve_fpu() ) ) );
+ & to) ) );
flags_ |= flag_running;
if ( from->do_unwind) throw forced_unwind();
BOOST_ASSERT( from->data);
@@ -149,8 +143,7 @@ protected:
flags_ |= flag_running;
caller_.jump(
callee_,
- reinterpret_cast< intptr_t >( to),
- preserve_fpu() );
+ to);
flags_ &= ~flag_running;
}
@@ -165,11 +158,10 @@ protected:
other->caller_ = caller_;
flags_ &= ~flag_running;
param_type * from(
- reinterpret_cast< param_type * >(
+ static_cast< param_type * >(
callee_.jump(
other->callee_,
- reinterpret_cast< intptr_t >( to),
- preserve_fpu() ) ) );
+ to) ) );
flags_ |= flag_running;
if ( from->do_unwind) throw forced_unwind();
BOOST_ASSERT( from->data);
@@ -184,13 +176,12 @@ public:
typedef parameters< R & > param_type;
symmetric_coroutine_impl( preallocated const& palloc,
- bool unwind, bool preserve_fpu) BOOST_NOEXCEPT :
+ bool unwind) BOOST_NOEXCEPT :
flags_( 0),
caller_(),
callee_( trampoline< symmetric_coroutine_impl< R > >, palloc)
{
if ( unwind) flags_ |= flag_force_unwind;
- if ( preserve_fpu) flags_ |= flag_preserve_fpu;
}
virtual ~symmetric_coroutine_impl() {}
@@ -201,9 +192,6 @@ public:
bool unwind_requested() const BOOST_NOEXCEPT
{ return 0 != ( flags_ & flag_unwind_stack); }
- bool preserve_fpu() const BOOST_NOEXCEPT
- { return 0 != ( flags_ & flag_preserve_fpu); }
-
bool is_started() const BOOST_NOEXCEPT
{ return 0 != ( flags_ & flag_started); }
@@ -222,8 +210,7 @@ public:
param_type to( unwind_t::force_unwind);
caller_.jump(
callee_,
- reinterpret_cast< intptr_t >( & to),
- preserve_fpu() );
+ & to);
flags_ &= ~flag_running;
flags_ &= ~flag_unwind_stack;
@@ -245,11 +232,10 @@ public:
flags_ &= ~flag_running;
param_type to;
param_type * from(
- reinterpret_cast< param_type * >(
+ static_cast< param_type * >(
callee_.jump(
caller_,
- reinterpret_cast< intptr_t >( & to),
- preserve_fpu() ) ) );
+ & to) ) );
flags_ |= flag_running;
if ( from->do_unwind) throw forced_unwind();
BOOST_ASSERT( from->data);
@@ -297,8 +283,7 @@ protected:
flags_ |= flag_running;
caller_.jump(
callee_,
- reinterpret_cast< intptr_t >( to),
- preserve_fpu() );
+ to);
flags_ &= ~flag_running;
}
@@ -313,11 +298,10 @@ protected:
other->caller_ = caller_;
flags_ &= ~flag_running;
param_type * from(
- reinterpret_cast< param_type * >(
+ static_cast< param_type * >(
callee_.jump(
other->callee_,
- reinterpret_cast< intptr_t >( to),
- preserve_fpu() ) ) );
+ to) ) );
flags_ |= flag_running;
if ( from->do_unwind) throw forced_unwind();
BOOST_ASSERT( from->data);
@@ -332,13 +316,12 @@ public:
typedef parameters< void > param_type;
symmetric_coroutine_impl( preallocated const& palloc,
- bool unwind, bool preserve_fpu) BOOST_NOEXCEPT :
+ bool unwind) BOOST_NOEXCEPT :
flags_( 0),
caller_(),
callee_( trampoline_void< symmetric_coroutine_impl< void > >, palloc)
{
if ( unwind) flags_ |= flag_force_unwind;
- if ( preserve_fpu) flags_ |= flag_preserve_fpu;
}
virtual ~symmetric_coroutine_impl() {}
@@ -349,9 +332,6 @@ public:
inline bool unwind_requested() const BOOST_NOEXCEPT
{ return 0 != ( flags_ & flag_unwind_stack); }
- inline bool preserve_fpu() const BOOST_NOEXCEPT
- { return 0 != ( flags_ & flag_preserve_fpu); }
-
inline bool is_started() const BOOST_NOEXCEPT
{ return 0 != ( flags_ & flag_started); }
@@ -370,8 +350,7 @@ public:
param_type to( unwind_t::force_unwind);
caller_.jump(
callee_,
- reinterpret_cast< intptr_t >( & to),
- preserve_fpu() );
+ & to);
flags_ &= ~flag_running;
flags_ &= ~flag_unwind_stack;
@@ -388,8 +367,7 @@ public:
flags_ |= flag_running;
caller_.jump(
callee_,
- reinterpret_cast< intptr_t >( & to),
- preserve_fpu() );
+ & to);
flags_ &= ~flag_running;
}
@@ -401,11 +379,10 @@ public:
flags_ &= ~flag_running;
param_type to;
param_type * from(
- reinterpret_cast< param_type * >(
+ static_cast< param_type * >(
callee_.jump(
caller_,
- reinterpret_cast< intptr_t >( & to),
- preserve_fpu() ) ) );
+ & to) ) );
flags_ |= flag_running;
if ( from->do_unwind) throw forced_unwind();
}
@@ -454,11 +431,10 @@ protected:
other->caller_ = caller_;
flags_ &= ~flag_running;
param_type * from(
- reinterpret_cast< param_type * >(
+ static_cast< param_type * >(
callee_.jump(
other->callee_,
- reinterpret_cast< intptr_t >( to),
- preserve_fpu() ) ) );
+ to) ) );
flags_ |= flag_running;
if ( from->do_unwind) throw forced_unwind();
}