diff --git a/doc/stack.qbk b/doc/stack.qbk index cb2528d..170e39b 100644 --- a/doc/stack.qbk +++ b/doc/stack.qbk @@ -63,7 +63,7 @@ virtual addresses are used.] class protected_stack_allocator { - static bool is_stack_unbound(); + static bool is_stack_unbounded(); static std::size_t maximum_stacksize(); @@ -76,7 +76,7 @@ virtual addresses are used.] void deallocate( stack_context &); } -[heading `static bool is_stack_unbound()`] +[heading `static bool is_stack_unbounded()`] [variablelist [[Returns:] [Returns `true` if the environment defines no limit for the size of a stack.]] @@ -84,7 +84,7 @@ a stack.]] [heading `static std::size_t maximum_stacksize()`] [variablelist -[[Preconditions:] [`is_stack_unbound()` returns `false`.]] +[[Preconditions:] [`is_stack_unbounded()` returns `false`.]] [[Returns:] [Returns the maximum size in bytes of stack defined by the environment.]] ] @@ -133,7 +133,7 @@ end of each stack. The memory is simply managed by `std::malloc()` and class standard_stack_allocator { - static bool is_stack_unbound(); + static bool is_stack_unbounded(); static std::size_t maximum_stacksize(); @@ -146,7 +146,7 @@ end of each stack. The memory is simply managed by `std::malloc()` and void deallocate( stack_context &); } -[heading `static bool is_stack_unbound()`] +[heading `static bool is_stack_unbounded()`] [variablelist [[Returns:] [Returns `true` if the environment defines no limit for the size of a stack.]] @@ -154,7 +154,7 @@ a stack.]] [heading `static std::size_t maximum_stacksize()`] [variablelist -[[Preconditions:] [`is_stack_unbound()` returns `false`.]] +[[Preconditions:] [`is_stack_unbounded()` returns `false`.]] [[Returns:] [Returns the maximum size in bytes of stack defined by the environment.]] ] diff --git a/include/boost/coroutine/protected_stack_allocator.hpp b/include/boost/coroutine/protected_stack_allocator.hpp index 73bb978..15735ac 100644 --- a/include/boost/coroutine/protected_stack_allocator.hpp +++ b/include/boost/coroutine/protected_stack_allocator.hpp @@ -25,7 +25,7 @@ struct stack_context; class BOOST_COROUTINES_DECL protected_stack_allocator { public: - static bool is_stack_unbound(); + static bool is_stack_unbounded(); static std::size_t default_stacksize(); diff --git a/include/boost/coroutine/segmented_stack_allocator.hpp b/include/boost/coroutine/segmented_stack_allocator.hpp index 984fedb..d768603 100644 --- a/include/boost/coroutine/segmented_stack_allocator.hpp +++ b/include/boost/coroutine/segmented_stack_allocator.hpp @@ -26,7 +26,7 @@ struct stack_context; class BOOST_COROUTINES_DECL segmented_stack_allocator { public: - static bool is_stack_unbound(); + static bool is_stack_unbounded(); static std::size_t default_stacksize(); diff --git a/include/boost/coroutine/standard_stack_allocator.hpp b/include/boost/coroutine/standard_stack_allocator.hpp index b05f32a..9e0ec17 100644 --- a/include/boost/coroutine/standard_stack_allocator.hpp +++ b/include/boost/coroutine/standard_stack_allocator.hpp @@ -25,7 +25,7 @@ struct stack_context; class BOOST_COROUTINES_DECL standard_stack_allocator { public: - static bool is_stack_unbound(); + static bool is_stack_unbounded(); static std::size_t maximum_stacksize(); diff --git a/src/protected_stack_allocator_posix.cpp b/src/protected_stack_allocator_posix.cpp index dfafe3b..123554e 100644 --- a/src/protected_stack_allocator_posix.cpp +++ b/src/protected_stack_allocator_posix.cpp @@ -84,14 +84,14 @@ std::size_t page_count( std::size_t stacksize) } bool -protected_stack_allocator::is_stack_unbound() +protected_stack_allocator::is_stack_unbounded() { return RLIM_INFINITY == stacksize_limit().rlim_max; } std::size_t protected_stack_allocator::default_stacksize() { std::size_t size = 8 * minimum_stacksize(); - if ( is_stack_unbound() ) return size; + if ( is_stack_unbounded() ) return size; BOOST_ASSERT( maximum_stacksize() >= minimum_stacksize() ); return maximum_stacksize() == size @@ -106,7 +106,7 @@ protected_stack_allocator::minimum_stacksize() std::size_t protected_stack_allocator::maximum_stacksize() { - BOOST_ASSERT( ! is_stack_unbound() ); + BOOST_ASSERT( ! is_stack_unbounded() ); return static_cast< std::size_t >( stacksize_limit().rlim_max); } @@ -114,7 +114,7 @@ void protected_stack_allocator::allocate( stack_context & ctx, std::size_t size) { BOOST_ASSERT( minimum_stacksize() <= size); - BOOST_ASSERT( is_stack_unbound() || ( maximum_stacksize() >= size) ); + BOOST_ASSERT( is_stack_unbounded() || ( maximum_stacksize() >= size) ); const std::size_t pages( page_count( size) ); // page at bottom will be used as guard-page BOOST_ASSERT_MSG( 2 <= pages, "at least two pages must fit into stack (one page is guard-page)"); @@ -153,7 +153,7 @@ protected_stack_allocator::deallocate( stack_context & ctx) { BOOST_ASSERT( ctx.sp); BOOST_ASSERT( minimum_stacksize() <= ctx.size); - BOOST_ASSERT( is_stack_unbound() || ( maximum_stacksize() >= ctx.size) ); + BOOST_ASSERT( is_stack_unbounded() || ( maximum_stacksize() >= ctx.size) ); void * limit = static_cast< char * >( ctx.sp) - ctx.size; // conform to POSIX.4 (POSIX.1b-1993, _POSIX_C_SOURCE=199309L) diff --git a/src/protected_stack_allocator_windows.cpp b/src/protected_stack_allocator_windows.cpp index 5612bb9..1b0df4e 100644 --- a/src/protected_stack_allocator_windows.cpp +++ b/src/protected_stack_allocator_windows.cpp @@ -73,14 +73,14 @@ std::size_t page_count( std::size_t stacksize) // Windows seams not to provide a limit for the stacksize bool -protected_stack_allocator::is_stack_unbound() +protected_stack_allocator::is_stack_unbounded() { return true; } std::size_t protected_stack_allocator::default_stacksize() { std::size_t size = 64 * 1024; // 64 kB - if ( is_stack_unbound() ) + if ( is_stack_unbounded() ) return (std::max)( size, minimum_stacksize() ); BOOST_ASSERT( maximum_stacksize() >= minimum_stacksize() ); @@ -95,11 +95,11 @@ protected_stack_allocator::minimum_stacksize() { return MIN_STACKSIZE; } // because Windows seams not to provide a limit for maximum stacksize -// maximum_stacksize() can never be called (pre-condition ! is_stack_unbound() ) +// maximum_stacksize() can never be called (pre-condition ! is_stack_unbounded() ) std::size_t protected_stack_allocator::maximum_stacksize() { - BOOST_ASSERT( ! is_stack_unbound() ); + BOOST_ASSERT( ! is_stack_unbounded() ); return 1 * 1024 * 1024 * 1024; // 1GB } @@ -107,7 +107,7 @@ void protected_stack_allocator::allocate( stack_context & ctx, std::size_t size) { BOOST_ASSERT( minimum_stacksize() <= size); - BOOST_ASSERT( is_stack_unbound() || ( maximum_stacksize() >= size) ); + BOOST_ASSERT( is_stack_unbounded() || ( maximum_stacksize() >= size) ); const std::size_t pages( page_count( size) ); // page at bottom will be used as guard-page BOOST_ASSERT_MSG( 2 <= pages, "at least two pages must fit into stack (one page is guard-page)"); @@ -138,7 +138,7 @@ protected_stack_allocator::deallocate( stack_context & ctx) { BOOST_ASSERT( ctx.sp); BOOST_ASSERT( minimum_stacksize() <= ctx.size); - BOOST_ASSERT( is_stack_unbound() || ( maximum_stacksize() >= ctx.size) ); + BOOST_ASSERT( is_stack_unbounded() || ( maximum_stacksize() >= ctx.size) ); void * limit = static_cast< char * >( ctx.sp) - ctx.size; ::VirtualFree( limit, 0, MEM_RELEASE); diff --git a/src/segmented_stack_allocator.cpp b/src/segmented_stack_allocator.cpp index 3ca8975..7bfcdd9 100644 --- a/src/segmented_stack_allocator.cpp +++ b/src/segmented_stack_allocator.cpp @@ -38,7 +38,7 @@ namespace boost { namespace coroutines { bool -segmented_stack_allocator::is_stack_unbound() +segmented_stack_allocator::is_stack_unbounded() { return true; } std::size_t diff --git a/src/standard_stack_allocator.cpp b/src/standard_stack_allocator.cpp index 998134b..89eaa48 100644 --- a/src/standard_stack_allocator.cpp +++ b/src/standard_stack_allocator.cpp @@ -22,8 +22,8 @@ namespace boost { namespace coroutines { bool -standard_stack_allocator::is_stack_unbound() -{ return protected_stack_allocator::is_stack_unbound(); } +standard_stack_allocator::is_stack_unbounded() +{ return protected_stack_allocator::is_stack_unbounded(); } std::size_t standard_stack_allocator::maximum_stacksize() @@ -41,7 +41,7 @@ void standard_stack_allocator::allocate( stack_context & ctx, std::size_t size) { BOOST_ASSERT( minimum_stacksize() <= size); - BOOST_ASSERT( is_stack_unbound() || ( maximum_stacksize() >= size) ); + BOOST_ASSERT( is_stack_unbounded() || ( maximum_stacksize() >= size) ); void * limit = std::malloc( size); if ( ! limit) throw std::bad_alloc(); @@ -55,7 +55,7 @@ standard_stack_allocator::deallocate( stack_context & ctx) { BOOST_ASSERT( ctx.sp); BOOST_ASSERT( minimum_stacksize() <= ctx.size); - BOOST_ASSERT( is_stack_unbound() || ( maximum_stacksize() >= ctx.size) ); + BOOST_ASSERT( is_stack_unbounded() || ( maximum_stacksize() >= ctx.size) ); void * limit = static_cast< char * >( ctx.sp) - ctx.size; std::free( limit);