diff options
Diffstat (limited to 'boost/coroutine/detail/trampoline_push.hpp')
-rw-r--r-- | boost/coroutine/detail/trampoline_push.hpp | 22 |
1 files changed, 12 insertions, 10 deletions
diff --git a/boost/coroutine/detail/trampoline_push.hpp b/boost/coroutine/detail/trampoline_push.hpp index 448904456e..80f90d0518 100644 --- a/boost/coroutine/detail/trampoline_push.hpp +++ b/boost/coroutine/detail/trampoline_push.hpp @@ -11,11 +11,13 @@ #include <boost/assert.hpp> #include <boost/config.hpp> +#include <boost/context/detail/fcontext.hpp> #include <boost/cstdint.hpp> #include <boost/exception_ptr.hpp> #include <boost/move/move.hpp> #include <boost/coroutine/detail/config.hpp> +#include <boost/coroutine/detail/data.hpp> #include <boost/coroutine/detail/flags.hpp> #include <boost/coroutine/detail/parameters.hpp> #include <boost/coroutine/detail/setup.hpp> @@ -32,37 +34,37 @@ namespace coroutines { namespace detail { template< typename Coro > -void trampoline_push( intptr_t vp) +void trampoline_push( context::detail::transfer_t t) { typedef typename Coro::param_type param_type; - BOOST_ASSERT( vp); - + data_t * data = static_cast< data_t * >( t.data); + data->from->ctx_ = t.fctx; param_type * param( - reinterpret_cast< param_type * >( vp) ); + static_cast< param_type * >( data->data) ); BOOST_ASSERT( 0 != param); BOOST_ASSERT( 0 != param->data); Coro * coro( - reinterpret_cast< Coro * >( param->coro) ); + static_cast< Coro * >( param->coro) ); BOOST_ASSERT( 0 != coro); coro->run( param->data); } template< typename Coro > -void trampoline_push_void( intptr_t vp) +void trampoline_push_void( context::detail::transfer_t t) { typedef typename Coro::param_type param_type; - BOOST_ASSERT( vp); - + data_t * data = static_cast< data_t * >( t.data); + data->from->ctx_ = t.fctx; param_type * param( - reinterpret_cast< param_type * >( vp) ); + static_cast< param_type * >( data->data) ); BOOST_ASSERT( 0 != param); Coro * coro( - reinterpret_cast< Coro * >( param->coro) ); + static_cast< Coro * >( param->coro) ); BOOST_ASSERT( 0 != coro); coro->run(); |