Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r82602 - trunk/boost/coroutine/detail
From: oliver.kowalke_at_[hidden]
Date: 2013-01-25 04:03:45


Author: olli
Date: 2013-01-25 04:03:44 EST (Fri, 25 Jan 2013)
New Revision: 82602
URL: http://svn.boost.org/trac/boost/changeset/82602

Log:
coroutine: make eval. of return values depended on BOOST_DISABLE_ASSERTS

Text files modified:
   trunk/boost/coroutine/detail/stack_allocator_posix.hpp | 8 ++++++++
   trunk/boost/coroutine/detail/stack_allocator_windows.hpp | 5 +++++
   2 files changed, 13 insertions(+), 0 deletions(-)

Modified: trunk/boost/coroutine/detail/stack_allocator_posix.hpp
==============================================================================
--- trunk/boost/coroutine/detail/stack_allocator_posix.hpp (original)
+++ trunk/boost/coroutine/detail/stack_allocator_posix.hpp 2013-01-25 04:03:44 EST (Fri, 25 Jan 2013)
@@ -59,8 +59,12 @@
 {
     rlimit limit;
     // conforming to POSIX.1-2001
+#if defined(BOOST_DISABLE_ASSERTS)
+ ::getrlimit( RLIMIT_STACK, & limit);
+#else
     const int result = ::getrlimit( RLIMIT_STACK, & limit);
     BOOST_ASSERT( 0 == result);
+#endif
     return limit;
 }
 
@@ -129,8 +133,12 @@
         std::memset( limit, size_, '\0');
 
         // conforming to POSIX.1-2001
+#if defined(BOOST_DISABLE_ASSERTS)
+ ::mprotect( limit, pagesize(), PROT_NONE);
+#else
         const int result( ::mprotect( limit, pagesize(), PROT_NONE) );
         BOOST_ASSERT( 0 == result);
+#endif
 
         return static_cast< char * >( limit) + size_;
     }

Modified: trunk/boost/coroutine/detail/stack_allocator_windows.hpp
==============================================================================
--- trunk/boost/coroutine/detail/stack_allocator_windows.hpp (original)
+++ trunk/boost/coroutine/detail/stack_allocator_windows.hpp 2013-01-25 04:03:44 EST (Fri, 25 Jan 2013)
@@ -126,9 +126,14 @@
         std::memset( limit, size_, '\0');
 
         DWORD old_options;
+#if defined(BOOST_DISABLE_ASSERTS)
+ ::VirtualProtect(
+ limit, pagesize(), PAGE_READWRITE | PAGE_GUARD /*PAGE_NOACCESS*/, & old_options);
+#else
         const BOOL result = ::VirtualProtect(
             limit, pagesize(), PAGE_READWRITE | PAGE_GUARD /*PAGE_NOACCESS*/, & old_options);
         BOOST_ASSERT( FALSE != result);
+#endif
 
         return static_cast< char * >( limit) + size_;
     }


Boost-Commit list run by bdawes at acm.org, david.abrahams at rcn.com, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk