mirror of
https://github.com/boostorg/coroutine2.git
synced 2025-05-09 23:24:01 +00:00
segmented-stacks=on -> only segmented_stack is available
This commit is contained in:
parent
68913206d2
commit
cfc703732a
@ -194,6 +194,9 @@ address of the stack.]]
|
||||
[[Effects:] [Deallocates the stack space.]]
|
||||
]
|
||||
|
||||
[note If the library is compiled for segmented stacks, __segmented_stack__ is the only
|
||||
available stack allocator.]
|
||||
|
||||
[endsect]
|
||||
|
||||
|
||||
|
@ -100,7 +100,6 @@ int main() {
|
||||
std::istringstream is("1+1");
|
||||
// invert control flow
|
||||
coro_t::pull_type seq(
|
||||
boost::coroutines2::fixedsize_stack(),
|
||||
[&is]( coro_t::push_type & yield) {
|
||||
Parser p( is,
|
||||
[&yield](char ch){
|
||||
|
@ -47,11 +47,6 @@ int main() {
|
||||
#endif
|
||||
|
||||
boost::coroutines2::coroutine< void >::push_type sink(
|
||||
#if defined(BOOST_USE_SEGMENTED_STACKS)
|
||||
boost::coroutines2::segmented_stack(),
|
||||
#else
|
||||
boost::coroutines2::fixedsize_stack(),
|
||||
#endif
|
||||
[&]( boost::coroutines2::coroutine< void >::pull_type & source) {
|
||||
bar( count);
|
||||
source();
|
||||
|
@ -36,16 +36,4 @@
|
||||
# include <boost/config/auto_link.hpp>
|
||||
#endif
|
||||
|
||||
#if defined(BOOST_USE_SEGMENTED_STACKS)
|
||||
# if ! ( (defined(__GNUC__) && __GNUC__ > 3 && __GNUC_MINOR__ > 6) || \
|
||||
(defined(__clang__) && __clang_major__ > 2 && __clang_minor__ > 3) )
|
||||
# error "compiler does not support segmented_stack stacks"
|
||||
# endif
|
||||
# define BOOST_COROUTINES2_SEGMENTS 10
|
||||
#endif
|
||||
|
||||
#if defined(BOOST_CONTEXT_NO_EXECUTION_CONTEXT)
|
||||
# error "execution_context from boost.context not supported"
|
||||
#endif
|
||||
|
||||
#endif // BOOST_COROUTINES2_DETAIL_CONFIG_H
|
||||
|
@ -19,6 +19,7 @@
|
||||
|
||||
#include <boost/coroutine2/detail/config.hpp>
|
||||
#include <boost/coroutine2/fixedsize_stack.hpp>
|
||||
#include <boost/coroutine2/segmented_stack.hpp>
|
||||
|
||||
#ifdef BOOST_HAS_ABI_HEADERS
|
||||
# include BOOST_ABI_PREFIX
|
||||
@ -44,7 +45,7 @@ pull_coroutine< T >::has_result_() const {
|
||||
template< typename T >
|
||||
template< typename Fn >
|
||||
pull_coroutine< T >::pull_coroutine( Fn && fn, bool preserve_fpu) :
|
||||
pull_coroutine( fixedsize_stack(), std::forward< Fn >( fn), preserve_fpu) {
|
||||
pull_coroutine( default_stack(), std::forward< Fn >( fn), preserve_fpu) {
|
||||
}
|
||||
|
||||
template< typename T >
|
||||
@ -127,7 +128,7 @@ pull_coroutine< T & >::has_result_() const {
|
||||
template< typename T >
|
||||
template< typename Fn >
|
||||
pull_coroutine< T & >::pull_coroutine( Fn && fn, bool preserve_fpu) :
|
||||
pull_coroutine( fixedsize_stack(), std::forward< Fn >( fn), preserve_fpu) {
|
||||
pull_coroutine( default_stack(), std::forward< Fn >( fn), preserve_fpu) {
|
||||
}
|
||||
|
||||
template< typename T >
|
||||
@ -203,7 +204,7 @@ pull_coroutine< void >::pull_coroutine( control_block * cb) :
|
||||
|
||||
template< typename Fn >
|
||||
pull_coroutine< void >::pull_coroutine( Fn && fn, bool preserve_fpu) :
|
||||
pull_coroutine( fixedsize_stack(), std::forward< Fn >( fn), preserve_fpu) {
|
||||
pull_coroutine( default_stack(), std::forward< Fn >( fn), preserve_fpu) {
|
||||
}
|
||||
|
||||
template< typename StackAllocator, typename Fn >
|
||||
|
@ -18,6 +18,7 @@
|
||||
|
||||
#include <boost/coroutine2/detail/config.hpp>
|
||||
#include <boost/coroutine2/fixedsize_stack.hpp>
|
||||
#include <boost/coroutine2/segmented_stack.hpp>
|
||||
|
||||
#ifdef BOOST_HAS_ABI_HEADERS
|
||||
# include BOOST_ABI_PREFIX
|
||||
@ -37,7 +38,7 @@ push_coroutine< T >::push_coroutine( control_block * cb) :
|
||||
template< typename T >
|
||||
template< typename Fn >
|
||||
push_coroutine< T >::push_coroutine( Fn && fn, bool preserve_fpu) :
|
||||
push_coroutine( fixedsize_stack(), std::forward< Fn >( fn), preserve_fpu) {
|
||||
push_coroutine( default_stack(), std::forward< Fn >( fn), preserve_fpu) {
|
||||
}
|
||||
|
||||
template< typename T >
|
||||
@ -115,7 +116,7 @@ push_coroutine< T & >::push_coroutine( control_block * cb) :
|
||||
template< typename T >
|
||||
template< typename Fn >
|
||||
push_coroutine< T & >::push_coroutine( Fn && fn, bool preserve_fpu) :
|
||||
push_coroutine( fixedsize_stack(), std::forward< Fn >( fn), preserve_fpu) {
|
||||
push_coroutine( default_stack(), std::forward< Fn >( fn), preserve_fpu) {
|
||||
}
|
||||
|
||||
template< typename T >
|
||||
@ -185,7 +186,7 @@ push_coroutine< void >::push_coroutine( control_block * cb) :
|
||||
|
||||
template< typename Fn >
|
||||
push_coroutine< void >::push_coroutine( Fn && fn, bool preserve_fpu) :
|
||||
push_coroutine( fixedsize_stack(), std::forward< Fn >( fn), preserve_fpu) {
|
||||
push_coroutine( default_stack(), std::forward< Fn >( fn), preserve_fpu) {
|
||||
}
|
||||
|
||||
template< typename StackAllocator, typename Fn >
|
||||
|
@ -23,6 +23,9 @@ namespace boost {
|
||||
namespace coroutines2 {
|
||||
|
||||
typedef boost::context::fixedsize_stack fixedsize_stack;
|
||||
#if !defined(BOOST_USE_SEGMENTED_STACKS)
|
||||
typedef boost::context::default_stack default_stack;
|
||||
#endif
|
||||
|
||||
}}
|
||||
|
||||
|
@ -25,6 +25,7 @@ namespace coroutines2 {
|
||||
#if defined(BOOST_USE_SEGMENTED_STACKS)
|
||||
# if ! defined(BOOST_WINDOWS)
|
||||
typedef boost::context::segmented_stack segmented_stack;
|
||||
typedef boost::context::default_stack default_stack;
|
||||
# endif
|
||||
#endif
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user