coroutine: fix memset() typo, add Licence and Copyright

[SVN r81767]
This commit is contained in:
Oliver Kowalke
2012-12-07 17:55:34 +00:00
parent bafc8297f6
commit 5bcd700e86
5 changed files with 31 additions and 63 deletions

View File

@@ -286,8 +286,7 @@ public:
impl_()
{
// BOOST_STATIC_ASSERT((
// is_same< typename result_of< Fn( caller_type &) >::type, void >::value
// ));
// is_same< void, typename result_of< Fn() >::type >::value));
typedef detail::coroutine_object<
Signature,
Fn, stack_allocator, std::allocator< coroutine >,
@@ -324,8 +323,7 @@ public:
impl_()
{
// BOOST_STATIC_ASSERT((
// is_same< typename result_of< Fn( caller_type &) >::type, void >::value
// ));
// is_same< void, typename result_of< Fn() >::type >::value));
typedef detail::coroutine_object<
Signature,
Fn, StackAllocator, std::allocator< coroutine >,
@@ -361,8 +359,7 @@ public:
impl_()
{
// BOOST_STATIC_ASSERT((
// is_same< typename result_of< Fn( caller_type &) >::type, void >::value
// ));
// is_same< void, typename result_of< Fn() >::type >::value));
typedef detail::coroutine_object<
Signature,
Fn, StackAllocator, Allocator,
@@ -400,8 +397,7 @@ public:
impl_()
{
// BOOST_STATIC_ASSERT((
// is_same< typename result_of< Fn( caller_type &) >::type, void >::value
// ));
// is_same< void, typename result_of< Fn() >::type >::value));
typedef detail::coroutine_object<
Signature,
Fn, stack_allocator, std::allocator< coroutine >,
@@ -438,8 +434,7 @@ public:
impl_()
{
// BOOST_STATIC_ASSERT((
// is_same< typename result_of< Fn( caller_type &) >::type, void >::value
// ));
// is_same< void, typename result_of< Fn() >::type >::value));
typedef detail::coroutine_object<
Signature,
Fn, StackAllocator, std::allocator< coroutine >,
@@ -475,8 +470,7 @@ public:
impl_()
{
// BOOST_STATIC_ASSERT((
// is_same< typename result_of< Fn( caller_type &) >::type, void >::value
// ));
// is_same< void, typename result_of< Fn() >::type >::value));
typedef detail::coroutine_object<
Signature,
Fn, StackAllocator, Allocator,
@@ -514,8 +508,7 @@ public:
impl_()
{
// BOOST_STATIC_ASSERT((
// is_same< typename result_of< Fn( caller_type &) >::type, void >::value
// ));
// is_same< void, typename result_of< Fn() >::type >::value));
typedef detail::coroutine_object<
Signature,
Fn, stack_allocator, std::allocator< coroutine >,
@@ -552,8 +545,7 @@ public:
impl_()
{
// BOOST_STATIC_ASSERT((
// is_same< typename result_of< Fn( caller_type &) >::type, void >::value
// ));
// is_same< void, typename result_of< Fn() >::type >::value));
typedef detail::coroutine_object<
Signature,
Fn, StackAllocator, std::allocator< coroutine >,
@@ -589,8 +581,7 @@ public:
impl_()
{
// BOOST_STATIC_ASSERT((
// is_same< typename result_of< Fn( caller_type &) >::type, void >::value
// ));
// is_same< void, typename result_of< Fn() >::type >::value));
typedef detail::coroutine_object<
Signature,
Fn, StackAllocator, Allocator,
@@ -873,8 +864,7 @@ public:
impl_()
{
// BOOST_STATIC_ASSERT((
// is_same< typename result_of< Fn( caller_type &) >::type, void >::value
// ));
// is_same< void, typename result_of< Fn() >::type >::value));
typedef detail::coroutine_object<
Signature,
Fn, stack_allocator, std::allocator< coroutine >,
@@ -912,8 +902,7 @@ public:
impl_()
{
// BOOST_STATIC_ASSERT((
// is_same< typename result_of< Fn( caller_type &) >::type, void >::value
// ));
// is_same< void, typename result_of< Fn() >::type >::value));
typedef detail::coroutine_object<
Signature,
Fn, stack_allocator, std::allocator< coroutine >,
@@ -950,8 +939,7 @@ public:
impl_()
{
// BOOST_STATIC_ASSERT((
// is_same< typename result_of< Fn( caller_type &) >::type, void >::value
// ));
// is_same< void, typename result_of< Fn() >::type >::value));
typedef detail::coroutine_object<
Signature,
Fn, StackAllocator, std::allocator< coroutine >,
@@ -988,8 +976,7 @@ public:
impl_()
{
// BOOST_STATIC_ASSERT((
// is_same< typename result_of< Fn( caller_type &) >::type, void >::value
// ));
// is_same< void, typename result_of< Fn() >::type >::value));
typedef detail::coroutine_object<
Signature,
Fn, StackAllocator, std::allocator< coroutine >,
@@ -1025,8 +1012,7 @@ public:
impl_()
{
// BOOST_STATIC_ASSERT((
// is_same< typename result_of< Fn( caller_type &) >::type, void >::value
// ));
// is_same< void, typename result_of< Fn() >::type >::value));
typedef detail::coroutine_object<
Signature,
Fn, StackAllocator, Allocator,
@@ -1062,8 +1048,7 @@ public:
impl_()
{
// BOOST_STATIC_ASSERT((
// is_same< typename result_of< Fn( caller_type &) >::type, void >::value
// ));
// is_same< void, typename result_of< Fn() >::type >::value));
typedef detail::coroutine_object<
Signature,
Fn, StackAllocator, Allocator,
@@ -1101,8 +1086,7 @@ public:
impl_()
{
// BOOST_STATIC_ASSERT((
// is_same< typename result_of< Fn( caller_type &) >::type, void >::value
// ));
// is_same< void, typename result_of< Fn() >::type >::value));
typedef detail::coroutine_object<
Signature,
Fn, stack_allocator, std::allocator< coroutine >,
@@ -1140,8 +1124,7 @@ public:
impl_()
{
// BOOST_STATIC_ASSERT((
// is_same< typename result_of< Fn( caller_type &) >::type, void >::value
// ));
// is_same< void, typename result_of< Fn() >::type >::value));
typedef detail::coroutine_object<
Signature,
Fn, stack_allocator, std::allocator< coroutine >,
@@ -1178,8 +1161,7 @@ public:
impl_()
{
// BOOST_STATIC_ASSERT((
// is_same< typename result_of< Fn( caller_type &) >::type, void >::value
// ));
// is_same< void, typename result_of< Fn() >::type >::value));
typedef detail::coroutine_object<
Signature,
Fn, StackAllocator, std::allocator< coroutine >,
@@ -1215,8 +1197,7 @@ public:
impl_()
{
// BOOST_STATIC_ASSERT((
// is_same< typename result_of< Fn( caller_type &) >::type, void >::value
// ));
// is_same< void, typename result_of< Fn() >::type >::value));
typedef detail::coroutine_object<
Signature,
Fn, StackAllocator, Allocator,
@@ -1254,8 +1235,7 @@ public:
impl_()
{
// BOOST_STATIC_ASSERT((
// is_same< typename result_of< Fn( caller_type &) >::type, void >::value
// ));
// is_same< void, typename result_of< Fn() >::type >::value));
typedef detail::coroutine_object<
Signature,
Fn, stack_allocator, std::allocator< coroutine >,
@@ -1292,8 +1272,7 @@ public:
impl_()
{
// BOOST_STATIC_ASSERT((
// is_same< typename result_of< Fn( caller_type &) >::type, void >::value
// ));
// is_same< void, typename result_of< Fn() >::type >::value));
typedef detail::coroutine_object<
Signature,
Fn, StackAllocator, std::allocator< coroutine >,
@@ -1329,8 +1308,7 @@ public:
impl_()
{
// BOOST_STATIC_ASSERT((
// is_same< typename result_of< Fn( caller_type &) >::type, void >::value
// ));
// is_same< void, typename result_of< Fn() >::type >::value));
typedef detail::coroutine_object<
Signature,
Fn, StackAllocator, Allocator,

View File

@@ -93,7 +93,7 @@ public:
BOOST_ASSERT( maximum_stacksize() >= minimum_stacksize() );
return maximum_stacksize() == size
? size
: (std::min)( size, maximum_stacksize() );
: std::min( size, maximum_stacksize() );
}
static std::size_t minimum_stacksize()
@@ -126,7 +126,7 @@ public:
::close( fd);
if ( ! limit) throw std::bad_alloc();
std::memset( limit, '\0', size_);
std::memset( limit, size_, '\0');
// conforming to POSIX.1-2001
const int result( ::mprotect( limit, pagesize(), PROT_NONE) );

View File

@@ -89,14 +89,16 @@ public:
static std::size_t default_stacksize()
{
using namespace std;
std::size_t size = 64 * 1024; // 64 kB
if ( is_stack_unbound() )
return (std::max)( size, minimum_stacksize() );
return max( size, minimum_stacksize() );
BOOST_ASSERT( maximum_stacksize() >= minimum_stacksize() );
return maximum_stacksize() == minimum_stacksize()
? minimum_stacksize()
: (std::min)( size, maximum_stacksize() );
: min( size, maximum_stacksize() );
}
// because Windows seams not to provide a limit for minimum stacksize
@@ -123,7 +125,7 @@ public:
void * limit = ::VirtualAlloc( 0, size_, MEM_COMMIT, PAGE_READWRITE);
if ( ! limit) throw std::bad_alloc();
std::memset( limit, '\0', size_);
std::memset( limit, size_, '\0');
DWORD old_options;
const BOOL result = ::VirtualProtect(