coroutine: remove deprecated interface

[SVN r86521]
This commit is contained in:
Oliver Kowalke
2013-10-30 08:23:09 +00:00
parent 03acada249
commit e5120a4b71
38 changed files with 3068 additions and 9220 deletions

View File

@@ -32,7 +32,6 @@ namespace coro = boost::coroutines;
# define CALL_COROUTINE(z,n,unused) \
c();
#ifdef BOOST_COROUTINES_UNIDIRECT
void fn( boost::coroutines::coroutine< void >::push_type & c)
{ while ( true) c(); }
@@ -87,64 +86,6 @@ BOOST_PP_REPEAT_FROM_TO( 0, BOOST_PP_LIMIT_MAG, CALL_COROUTINE, ~)
return total;
}
# endif
#else
typedef coro::coroutine< void() > coro_t;
void fn( coro_t::caller_type & c)
{ while ( true) c(); }
# ifdef BOOST_CONTEXT_CYCLE
cycle_t test_cycles( cycle_t ov, coro::flag_fpu_t preserve_fpu)
{
# if defined(BOOST_USE_SEGMENTED_STACKS)
coro_t c( fn, coro::attributes( preserve_fpu) );
# else
coro::simple_stack_allocator< 8 * 1024 * 1024, 64 * 1024, 8 * 1024 > alloc;
coro_t c( fn, coro::attributes( preserve_fpu), alloc);
# endif
// cache warum-up
BOOST_PP_REPEAT_FROM_TO( 0, COUNTER, CALL_COROUTINE, ~)
cycle_t start( cycles() );
BOOST_PP_REPEAT_FROM_TO( 0, COUNTER, CALL_COROUTINE, ~)
cycle_t total( cycles() - start);
// we have two jumps and two measuremt-overheads
total -= ov; // overhead of measurement
total /= COUNTER; // per call
total /= 2; // 2x jump_to c1->c2 && c2->c1
return total;
}
# endif
# if _POSIX_C_SOURCE >= 199309L
zeit_t test_zeit( zeit_t ov, coro::flag_fpu_t preserve_fpu)
{
# if defined(BOOST_USE_SEGMENTED_STACKS)
coro_t c( fn, coro::attributes( preserve_fpu) );
# else
coro::simple_stack_allocator< 8 * 1024 * 1024, 64 * 1024, 8 * 1024 > alloc;
coro_t c( fn, coro::attributes( preserve_fpu), alloc);
# endif
// cache warum-up
BOOST_PP_REPEAT_FROM_TO( 0, BOOST_PP_LIMIT_MAG, CALL_COROUTINE, ~)
zeit_t start( zeit() );
BOOST_PP_REPEAT_FROM_TO( 0, BOOST_PP_LIMIT_MAG, CALL_COROUTINE, ~)
zeit_t total( zeit() - start);
// we have two jumps and two measuremt-overheads
total -= ov; // overhead of measurement
total /= BOOST_PP_LIMIT_MAG; // per call
total /= 2; // 2x jump_to c1->c2 && c2->c1
return total;
}
# endif
#endif
int main( int argc, char * argv[])
{