apply std::allocator_arg as required by boost.context

This commit is contained in:
Oliver Kowalke 2015-09-26 20:23:04 +02:00
parent b5e475ff36
commit 4197d019f9
2 changed files with 134 additions and 132 deletions

View File

@ -8,6 +8,7 @@
#define BOOST_COROUTINES2_DETAIL_PULL_CONTROL_BLOCK_IPP #define BOOST_COROUTINES2_DETAIL_PULL_CONTROL_BLOCK_IPP
#include <exception> #include <exception>
#include <memory>
#include <boost/assert.hpp> #include <boost/assert.hpp>
#include <boost/config.hpp> #include <boost/config.hpp>
@ -33,7 +34,7 @@ template< typename StackAllocator, typename Fn >
pull_coroutine< T >::control_block::control_block( context::preallocated palloc, StackAllocator salloc, pull_coroutine< T >::control_block::control_block( context::preallocated palloc, StackAllocator salloc,
Fn && fn_, bool preserve_fpu_) : Fn && fn_, bool preserve_fpu_) :
other( nullptr), other( nullptr),
ctx( palloc, salloc, ctx( std::allocator_arg, palloc, salloc,
[=,fn=std::forward< Fn >( fn_),ctx=boost::context::execution_context::current()] () mutable -> void { [=,fn=std::forward< Fn >( fn_),ctx=boost::context::execution_context::current()] () mutable -> void {
// create synthesized push_coroutine< T > // create synthesized push_coroutine< T >
typename push_coroutine< T >::control_block synthesized_cb( this, ctx); typename push_coroutine< T >::control_block synthesized_cb( this, ctx);
@ -109,7 +110,7 @@ template< typename StackAllocator, typename Fn >
pull_coroutine< T & >::control_block::control_block( context::preallocated palloc, StackAllocator salloc, pull_coroutine< T & >::control_block::control_block( context::preallocated palloc, StackAllocator salloc,
Fn && fn_, bool preserve_fpu_) : Fn && fn_, bool preserve_fpu_) :
other( nullptr), other( nullptr),
ctx( palloc, salloc, ctx( std::allocator_arg, palloc, salloc,
[=,fn=std::forward< Fn >( fn_),ctx=boost::context::execution_context::current()] () mutable -> void { [=,fn=std::forward< Fn >( fn_),ctx=boost::context::execution_context::current()] () mutable -> void {
// create synthesized push_coroutine< T > // create synthesized push_coroutine< T >
typename push_coroutine< T & >::control_block synthesized_cb( this, ctx); typename push_coroutine< T & >::control_block synthesized_cb( this, ctx);
@ -184,7 +185,7 @@ template< typename StackAllocator, typename Fn >
pull_coroutine< void >::control_block::control_block( context::preallocated palloc, StackAllocator salloc, pull_coroutine< void >::control_block::control_block( context::preallocated palloc, StackAllocator salloc,
Fn && fn_, bool preserve_fpu_) : Fn && fn_, bool preserve_fpu_) :
other( nullptr), other( nullptr),
ctx( palloc, salloc, ctx( std::allocator_arg, palloc, salloc,
[=,fn=std::forward< Fn >( fn_),ctx=boost::context::execution_context::current()] () mutable -> void { [=,fn=std::forward< Fn >( fn_),ctx=boost::context::execution_context::current()] () mutable -> void {
// create synthesized push_coroutine< T > // create synthesized push_coroutine< T >
typename push_coroutine< void >::control_block synthesized_cb( this, ctx); typename push_coroutine< void >::control_block synthesized_cb( this, ctx);

View File

@ -9,6 +9,7 @@
#include <algorithm> #include <algorithm>
#include <exception> #include <exception>
#include <memory>
#include <boost/assert.hpp> #include <boost/assert.hpp>
#include <boost/config.hpp> #include <boost/config.hpp>
@ -34,7 +35,7 @@ template< typename StackAllocator, typename Fn >
push_coroutine< T >::control_block::control_block( context::preallocated palloc, StackAllocator salloc, push_coroutine< T >::control_block::control_block( context::preallocated palloc, StackAllocator salloc,
Fn && fn_, bool preserve_fpu_) : Fn && fn_, bool preserve_fpu_) :
other( nullptr), other( nullptr),
ctx( palloc, salloc, ctx( std::allocator_arg, palloc, salloc,
[=,fn=std::forward< Fn >( fn_),ctx=boost::context::execution_context::current()] () mutable -> void { [=,fn=std::forward< Fn >( fn_),ctx=boost::context::execution_context::current()] () mutable -> void {
// create synthesized pull_coroutine< T > // create synthesized pull_coroutine< T >
typename pull_coroutine< T >::control_block synthesized_cb( this, ctx); typename pull_coroutine< T >::control_block synthesized_cb( this, ctx);
@ -138,7 +139,7 @@ template< typename StackAllocator, typename Fn >
push_coroutine< T & >::control_block::control_block( context::preallocated palloc, StackAllocator salloc, push_coroutine< T & >::control_block::control_block( context::preallocated palloc, StackAllocator salloc,
Fn && fn_, bool preserve_fpu_) : Fn && fn_, bool preserve_fpu_) :
other( nullptr), other( nullptr),
ctx( palloc, salloc, ctx( std::allocator_arg, palloc, salloc,
[=,fn=std::forward< Fn >( fn_),ctx=boost::context::execution_context::current()] () mutable -> void { [=,fn=std::forward< Fn >( fn_),ctx=boost::context::execution_context::current()] () mutable -> void {
// create synthesized pull_coroutine< T > // create synthesized pull_coroutine< T >
typename pull_coroutine< T & >::control_block synthesized_cb( this, ctx); typename pull_coroutine< T & >::control_block synthesized_cb( this, ctx);
@ -218,7 +219,7 @@ push_coroutine< T & >::control_block::valid() const noexcept {
template< typename StackAllocator, typename Fn > template< typename StackAllocator, typename Fn >
push_coroutine< void >::control_block::control_block( context::preallocated palloc, StackAllocator salloc, Fn && fn_, bool preserve_fpu_) : push_coroutine< void >::control_block::control_block( context::preallocated palloc, StackAllocator salloc, Fn && fn_, bool preserve_fpu_) :
other( nullptr), other( nullptr),
ctx( palloc, salloc, ctx( std::allocator_arg, palloc, salloc,
[=,fn=std::forward< Fn >( fn_),ctx=boost::context::execution_context::current()] () mutable -> void { [=,fn=std::forward< Fn >( fn_),ctx=boost::context::execution_context::current()] () mutable -> void {
// create synthesized pull_coroutine< T > // create synthesized pull_coroutine< T >
typename pull_coroutine< void >::control_block synthesized_cb( this, ctx); typename pull_coroutine< void >::control_block synthesized_cb( this, ctx);