|
Boost-Commit : |
Subject: [Boost-commit] svn:boost r80375 - in trunk: boost/context libs/context/build libs/context/doc libs/context/src libs/context/test
From: oliver.kowalke_at_[hidden]
Date: 2012-09-03 13:06:57
Author: olli
Date: 2012-09-03 13:06:56 EDT (Mon, 03 Sep 2012)
New Revision: 80375
URL: http://svn.boost.org/trac/boost/changeset/80375
Log:
context: refactoring stack_allocator (Windows stack sizes etc.)
Removed:
trunk/boost/context/stack_utils.hpp
trunk/libs/context/src/stack_utils_posix.cpp
trunk/libs/context/src/stack_utils_windows.cpp
Text files modified:
trunk/boost/context/all.hpp | 1
trunk/boost/context/stack_allocator.hpp | 8 +++
trunk/libs/context/build/Jamfile.v2 | 2
trunk/libs/context/doc/stack.qbk | 76 ++++++++++++++++++-------------------
trunk/libs/context/src/stack_allocator_posix.cpp | 76 +++++++++++++++++++++++++++++++++++--
trunk/libs/context/src/stack_allocator_windows.cpp | 81 +++++++++++++++++++++++++++++++++++++--
trunk/libs/context/test/test_context.cpp | 34 ++++++++--------
7 files changed, 209 insertions(+), 69 deletions(-)
Modified: trunk/boost/context/all.hpp
==============================================================================
--- trunk/boost/context/all.hpp (original)
+++ trunk/boost/context/all.hpp 2012-09-03 13:06:56 EDT (Mon, 03 Sep 2012)
@@ -9,6 +9,5 @@
#include <boost/context/fcontext.hpp>
#include <boost/context/stack_allocator.hpp>
-#include <boost/context/stack_utils.hpp>
#endif // BOOST_CTX_ALL_H
Modified: trunk/boost/context/stack_allocator.hpp
==============================================================================
--- trunk/boost/context/stack_allocator.hpp (original)
+++ trunk/boost/context/stack_allocator.hpp 2012-09-03 13:06:56 EDT (Mon, 03 Sep 2012)
@@ -23,6 +23,14 @@
class BOOST_CONTEXT_DECL stack_allocator
{
public:
+ static bool is_stack_unbound();
+
+ static std::size_t default_stacksize();
+
+ static std::size_t minimum_stacksize();
+
+ static std::size_t maximum_stacksize();
+
void * allocate( std::size_t) const;
void deallocate( void *, std::size_t) const;
Deleted: trunk/boost/context/stack_utils.hpp
==============================================================================
--- trunk/boost/context/stack_utils.hpp 2012-09-03 13:06:56 EDT (Mon, 03 Sep 2012)
+++ (empty file)
@@ -1,41 +0,0 @@
-
-// Copyright Oliver Kowalke 2009.
-// Distributed under the Boost Software License, Version 1.0.
-// (See accompanying file LICENSE_1_0.txt or copy at
-// http://www.boost.org/LICENSE_1_0.txt)
-
-#ifndef BOOST_CTX_STACK_UTILS_H
-#define BOOST_CTX_STACK_UTILS_H
-
-#include <cstddef>
-
-#include <boost/config.hpp>
-
-#include <boost/context/detail/config.hpp>
-
-#ifdef BOOST_HAS_ABI_HEADERS
-# include BOOST_ABI_PREFIX
-#endif
-
-namespace boost {
-namespace ctx {
-
-BOOST_CONTEXT_DECL std::size_t default_stacksize();
-
-BOOST_CONTEXT_DECL std::size_t minimum_stacksize();
-
-BOOST_CONTEXT_DECL std::size_t maximum_stacksize();
-
-BOOST_CONTEXT_DECL std::size_t pagesize();
-
-BOOST_CONTEXT_DECL std::size_t page_count( std::size_t stacksize);
-
-BOOST_CONTEXT_DECL bool is_stack_unbound();
-
-}}
-
-#ifdef BOOST_HAS_ABI_HEADERS
-# include BOOST_ABI_SUFFIX
-#endif
-
-#endif // BOOST_CTX_STACK_UTILS_H
Modified: trunk/libs/context/build/Jamfile.v2
==============================================================================
--- trunk/libs/context/build/Jamfile.v2 (original)
+++ trunk/libs/context/build/Jamfile.v2 2012-09-03 13:06:56 EDT (Mon, 03 Sep 2012)
@@ -408,14 +408,12 @@
: fcontext.cpp
seh.cpp
stack_allocator_windows.cpp
- stack_utils_windows.cpp
: <target-os>windows
;
alias context_sources
: fcontext.cpp
stack_allocator_posix.cpp
- stack_utils_posix.cpp
;
explicit context_sources ;
Modified: trunk/libs/context/doc/stack.qbk
==============================================================================
--- trunk/libs/context/doc/stack.qbk (original)
+++ trunk/libs/context/doc/stack.qbk 2012-09-03 13:06:56 EDT (Mon, 03 Sep 2012)
@@ -9,11 +9,8 @@
A __fcontext__ requires a stack which will be allocated/deallocated
by a __stack_allocator__.
-__boost_context__ uses `stack_allocator` by default but a
-customized `stack allocator` can be passed to the context constructor
-instead.
-If a context is constructed it invokes __stack_alloc__ function and by its
-destruction the stack gets released by __stack_dealloc__.
+__boost_context__ provides the default implementation `stack_allocator` but a
+customized __stack_allocator__ can be used instead.
[heading __stack_allocator_concept__]
A __stack_allocator__ must satisfy the __stack_allocator_concept__ requirements
@@ -52,68 +49,69 @@
[section:stack_allocator Class `stack_allocator`]
-__boost_context__ provides a __stack_allocator__ `stack_allocator` which models
+__boost_context__ provides the default implementation `stack_allocator` which models
the __stack_allocator_concept__ concept.
-It creates a __guard_page__ at the end of the stack to protect against exceeding
+It appends a __guard_page__ at the end of the stack to protect against exceeding
the stack. If the guard page is accessed (read or write operation) a
segmentation fault/access violation is generated by the operating system.
-[endsect]
-
-
-[section:stack_helper Helper functions]
-
-__boost_context__ provides easy access to the stack related limits defined by
-the environment.
-
- std::size_t default_stacksize();
+ class stack_allocator
+ {
+ static bool is_stack_unbound();
- std::size_t minimum_stacksize();
+ static std::size_t maximum_stacksize();
- std::size_t maximum_stacksize();
+ static std::size_t default_stacksize();
- bool is_stack_unbound();
+ static std::size_t minimum_stacksize();
- std::size_t pagesize();
+ void * allocate( std::size_t size);
- std::size_t page_count( std::size_t stacksize);
-
-[heading `std::size_t default_stacksize()`]
-[variablelist
-[[Returns:] [Returns a default stack size, which may be platform specific.
-If the stack is unbound then the present implementation returns the maximum of
-`256 kB` and `minimum_stacksize()`.]]
-]
+ void deallocate( void * sp, std::size_t size);
+ }
-[heading `std::size_t minimum_stacksize()`]
+[heading `static bool is_stack_unbound()`]
[variablelist
-[[Returns:] [Returns the minimum size in bytes of stack defined by the
-environment plus a pagesize (guard page).]]
+[[Returns:] [Returns `true` if the environment defines no limit for the size of a stack.]]
[[Throws:] [Nothing.]]
]
-[heading `std::size_t maximum_stacksize()`]
+[heading `static std::size_t maximum_stacksize()`]
[variablelist
[[Preconditions:] [`is_stack_unbound()` returns `false`.]]
[[Returns:] [Returns the maximum size in bytes of stack defined by the environment.]]
[[Throws:] [Nothing.]]
]
-[heading `bool is_stack_unbound()`]
+[heading `static std::size_t default_stacksize()`]
[variablelist
-[[Returns:] [Returns `true` if the environment defines no limit for the size of a stack.]]
-[[Throws:] [Nothing.]]
+[[Returns:] [Returns a default stack size, which may be platform specific.
+If the stack is unbound then the present implementation returns the maximum of
+`64 kB` and `minimum_stacksize()`.]]
]
-[heading `std::size_t pagesize()`]
+[heading `static std::size_t minimum_stacksize()`]
[variablelist
-[[Returns:] [Returns how many bytes the operating system allocates for one page.]]
+[[Returns:] [Returns the minimum size in bytes of stack defined by the
+environment (Windows 4kB, defined by rlimit on POSIX).]]
[[Throws:] [Nothing.]]
]
-[heading `std::size_t page_count( std::size_t stacksize)`]
+[heading `void * allocate( std::size_t size)`]
+[variablelist
+[[Preconditions:] [`minimum_stacksize() > size` and
+`! is_stack_unbound() && ( maximum_stacksize() < size)`.]]
+[[Effects:] [Allocates memory of `size` Bytes and appends one guard page at the
+end of the allocated memory.]]
+[[Returns:] [Returns pointer to the start address of the new stack. Depending
+on the architecture the stack grows downwards/upwards the returned address is
+the highest/lowest address of the stack.]]
+[[Throws:] [std::invalid_argument if pre-conditions violated.]]
+]
+
+[heading `void deallocate( void * sp, std::size_t size)`]
[variablelist
-[[Returns:] [Returns how many pages have to be allocated for a stack of `stacksize` bytes.]]
+[[Effects:] [Deallocates the stack space.]]
[[Throws:] [Nothing.]]
]
Modified: trunk/libs/context/src/stack_allocator_posix.cpp
==============================================================================
--- trunk/libs/context/src/stack_allocator_posix.cpp (original)
+++ trunk/libs/context/src/stack_allocator_posix.cpp 2012-09-03 13:06:56 EDT (Mon, 03 Sep 2012)
@@ -10,28 +10,95 @@
extern "C" {
#include <fcntl.h>
+#include <signal.h>
#include <sys/mman.h>
+#include <sys/resource.h>
#include <sys/stat.h>
+#include <sys/time.h>
#include <sys/types.h>
#include <unistd.h>
+#include <unistd.h>
}
+#include <algorithm>
+#include <cmath>
#include <cstring>
#include <stdexcept>
-#include <boost/config.hpp>
#include <boost/assert.hpp>
+#include <boost/config.hpp>
#include <boost/format.hpp>
-#include <boost/context/stack_utils.hpp>
+#if !defined (SIGSTKSZ)
+# define SIGSTKSZ (8 * 1024)
+#endif
#ifdef BOOST_HAS_ABI_HEADERS
# include BOOST_ABI_PREFIX
#endif
+namespace {
+
+static rlimit stacksize_limit_()
+{
+ rlimit limit;
+ const int result = ::getrlimit( RLIMIT_STACK, & limit);
+ BOOST_ASSERT( 0 == result);
+ return limit;
+}
+
+static rlimit stacksize_limit()
+{
+ static rlimit limit = stacksize_limit_();
+ return limit;
+}
+
+static std::size_t pagesize()
+{
+ static std::size_t size = ::getpagesize();
+ return size;
+}
+
+static std::size_t page_count( std::size_t stacksize)
+{
+ return static_cast< std::size_t >(
+ std::ceil(
+ static_cast< float >( stacksize) / pagesize() ) );
+}
+
+}
+
namespace boost {
namespace ctx {
+bool
+stack_allocator::is_stack_unbound()
+{ return RLIM_INFINITY == stacksize_limit().rlim_max; }
+
+std::size_t
+stack_allocator::maximum_stacksize()
+{
+ BOOST_ASSERT( ! is_stack_unbound() );
+ return static_cast< std::size_t >( stacksize_limit().rlim_max);
+}
+
+std::size_t
+stack_allocator::minimum_stacksize()
+{ return SIGSTKSZ; }
+
+std::size_t
+stack_allocator::default_stacksize()
+{
+ std::size_t size = 64 * 1024; // 64 kB
+ if ( is_stack_unbound() )
+ return std::max( size, minimum_stacksize() );
+
+ BOOST_ASSERT( maximum_stacksize() >= minimum_stacksize() );
+ return maximum_stacksize() == minimum_stacksize()
+ ? minimum_stacksize()
+ : std::min( size, maximum_stacksize() );
+}
+
void *
stack_allocator::allocate( std::size_t size) const
{
@@ -45,8 +112,7 @@
boost::str( boost::format("invalid stack size: must not be larger than %d bytes")
% maximum_stacksize() ) );
- const std::size_t pages( page_count( size) );
- BOOST_ASSERT( 2 <= pages); // one page is reserved for protection
+ const std::size_t pages( page_count( size) + 1); // add one guard page
const std::size_t size_( pages * pagesize() );
BOOST_ASSERT( 0 < size && 0 < size_);
@@ -74,7 +140,7 @@
{
if ( vp)
{
- const std::size_t pages = page_count( size);
+ const std::size_t pages = page_count( size) + 1;
const std::size_t size_ = pages * pagesize();
BOOST_ASSERT( 0 < size && 0 < size_);
void * limit = static_cast< char * >( vp) - size_;
Modified: trunk/libs/context/src/stack_allocator_windows.cpp
==============================================================================
--- trunk/libs/context/src/stack_allocator_windows.cpp (original)
+++ trunk/libs/context/src/stack_allocator_windows.cpp 2012-09-03 13:06:56 EDT (Mon, 03 Sep 2012)
@@ -5,6 +5,7 @@
// http://www.boost.org/LICENSE_1_0.txt)
#define BOOST_CONTEXT_SOURCE
+#define NOMINMAX
#include <boost/context/stack_allocator.hpp>
@@ -12,6 +13,9 @@
#include <windows.h>
}
+#include <algorithm>
+#include <cmath>
+#include <csignal>
#include <cstring>
#include <stdexcept>
@@ -20,20 +24,88 @@
#include <boost/cstdint.hpp>
#include <boost/format.hpp>
-#include <boost/context/stack_utils.hpp>
-
# if defined(BOOST_MSVC)
# pragma warning(push)
# pragma warning(disable:4244 4267)
# endif
+// x86_64
+// test x86_64 before i386 because icc might
+// define __i686__ for x86_64 too
+#if defined(__x86_64__) || defined(__x86_64) \
+ || defined(__amd64__) || defined(__amd64) \
+ || defined(_M_X64) || defined(_M_AMD64)
+# define MIN_STACKSIZE 9 * 1024 // 8kB will cause an excpetion on x64 Windows (exception handling)
+#else
+# define MIN_STACKSIZE 4 * 1024
+#endif
+
#ifdef BOOST_HAS_ABI_HEADERS
# include BOOST_ABI_PREFIX
#endif
+namespace {
+
+static SYSTEM_INFO system_info_()
+{
+ SYSTEM_INFO si;
+ ::GetSystemInfo( & si);
+ return si;
+}
+
+static SYSTEM_INFO system_info()
+{
+ static SYSTEM_INFO si = system_info_();
+ return si;
+}
+
+static std::size_t pagesize()
+{ return static_cast< std::size_t >( system_info().dwPageSize); }
+
+static std::size_t page_count( std::size_t stacksize)
+{
+ return static_cast< std::size_t >(
+ std::ceil(
+ static_cast< float >( stacksize) / pagesize() ) );
+}
+
+}
+
namespace boost {
namespace ctx {
+// Windows seams not to provide a limit for the stacksize
+bool
+stack_allocator::is_stack_unbound()
+{ return true; }
+
+// because Windows seams not to provide a limit for maximum stacksize
+// maximum_stacksize() can never be called (pre-condition ! is_stack_unbound() )
+std::size_t
+stack_allocator::maximum_stacksize()
+{
+ BOOST_ASSERT( ! is_stack_unbound() );
+ return 1 * 1024 * 1024 * 1024; // 1GB
+}
+
+// because Windows seams not to provide a limit for minimum stacksize
+std::size_t
+stack_allocator::minimum_stacksize()
+{ return MIN_STACKSIZE; }
+
+std::size_t
+stack_allocator::default_stacksize()
+{
+ std::size_t size = 64 * 1024; // 64 kB
+ if ( is_stack_unbound() )
+ return std::max( size, minimum_stacksize() );
+
+ BOOST_ASSERT( maximum_stacksize() >= minimum_stacksize() );
+ return maximum_stacksize() == minimum_stacksize()
+ ? minimum_stacksize()
+ : std::min( size, maximum_stacksize() );
+}
+
void *
stack_allocator::allocate( std::size_t size) const
{
@@ -47,8 +119,7 @@
boost::str( boost::format("invalid stack size: must not be larger than %d bytes")
% maximum_stacksize() ) );
- const std::size_t pages( page_count( size) );
- BOOST_ASSERT( 2 <= pages); // one page is reserved for protection
+ const std::size_t pages( page_count( size) + 1); // add one guard page
const std::size_t size_ = pages * pagesize();
BOOST_ASSERT( 0 < size && 0 < size_);
@@ -70,7 +141,7 @@
{
if ( vp)
{
- const std::size_t pages = page_count( size);
+ const std::size_t pages = page_count( size) + 1;
const std::size_t size_ = pages * pagesize();
BOOST_ASSERT( 0 < size && 0 < size_);
void * limit = static_cast< char * >( vp) - size_;
Deleted: trunk/libs/context/src/stack_utils_posix.cpp
==============================================================================
--- trunk/libs/context/src/stack_utils_posix.cpp 2012-09-03 13:06:56 EDT (Mon, 03 Sep 2012)
+++ (empty file)
@@ -1,102 +0,0 @@
-
-// Copyright Oliver Kowalke 2009.
-// Distributed under the Boost Software License, Version 1.0.
-// (See accompanying file LICENSE_1_0.txt or copy at
-// http://www.boost.org/LICENSE_1_0.txt)
-
-#define BOOST_CONTEXT_SOURCE
-
-#include <algorithm>
-
-#include <boost/context/stack_utils.hpp>
-
-extern "C" {
-#include <signal.h>
-#include <sys/resource.h>
-#include <sys/time.h>
-#include <unistd.h>
-}
-
-#include <cmath>
-
-#include <boost/assert.hpp>
-
-#if !defined (SIGSTKSZ)
-# define SIGSTKSZ (8 * 1024)
-#endif
-
-namespace {
-
-static rlimit stacksize_limit_()
-{
- rlimit limit;
- const int result = ::getrlimit( RLIMIT_STACK, & limit);
- BOOST_ASSERT( 0 == result);
- return limit;
-}
-
-static rlimit stacksize_limit()
-{
- static rlimit limit = stacksize_limit_();
- return limit;
-}
-
-static std::size_t compute_default_stacksize_()
-{
- std::size_t size = 256 * 1024; // 256 kB
- if ( boost::ctx::is_stack_unbound() )
- return std::max( size, boost::ctx::minimum_stacksize() );
-
- BOOST_ASSERT( boost::ctx::maximum_stacksize() >= boost::ctx::minimum_stacksize() );
- return boost::ctx::maximum_stacksize() == boost::ctx::minimum_stacksize()
- ? boost::ctx::minimum_stacksize()
- : std::min( size, boost::ctx::maximum_stacksize() );
-}
-
-}
-
-namespace boost {
-namespace ctx {
-
-BOOST_CONTEXT_DECL
-std::size_t pagesize()
-{
- static std::size_t size = ::getpagesize();
- return size;
-}
-
-BOOST_CONTEXT_DECL
-std::size_t page_count( std::size_t stacksize)
-{
- return static_cast< std::size_t >(
- std::ceil(
- static_cast< float >( stacksize) / pagesize() ) );
-}
-
-BOOST_CONTEXT_DECL
-bool is_stack_unbound()
-{ return RLIM_INFINITY == stacksize_limit().rlim_max; }
-
-BOOST_CONTEXT_DECL
-std::size_t maximum_stacksize()
-{
- BOOST_ASSERT( ! is_stack_unbound() );
- return static_cast< std::size_t >( stacksize_limit().rlim_max);
-}
-
-BOOST_CONTEXT_DECL
-std::size_t minimum_stacksize()
-{
- // space for guard page added
- static std::size_t size = SIGSTKSZ + pagesize();
- return size;
-}
-
-BOOST_CONTEXT_DECL
-std::size_t default_stacksize()
-{
- static std::size_t size = compute_default_stacksize_();
- return size;
-}
-
-}}
Deleted: trunk/libs/context/src/stack_utils_windows.cpp
==============================================================================
--- trunk/libs/context/src/stack_utils_windows.cpp 2012-09-03 13:06:56 EDT (Mon, 03 Sep 2012)
+++ (empty file)
@@ -1,100 +0,0 @@
-
-// Copyright Oliver Kowalke 2009.
-// Distributed under the Boost Software License, Version 1.0.
-// (See accompanying file LICENSE_1_0.txt or copy at
-// http://www.boost.org/LICENSE_1_0.txt)
-
-#define BOOST_CONTEXT_SOURCE
-#define NOMINMAX
-
-#include <boost/context/stack_utils.hpp>
-
-extern "C" {
-#include <windows.h>
-}
-
-#include <cmath>
-#include <csignal>
-#include <algorithm>
-
-#include <boost/assert.hpp>
-
-namespace {
-
-static SYSTEM_INFO system_info_()
-{
- SYSTEM_INFO si;
- ::GetSystemInfo( & si);
- return si;
-}
-
-static SYSTEM_INFO system_info()
-{
- static SYSTEM_INFO si = system_info_();
- return si;
-}
-
-static std::size_t compute_default_stacksize_()
-{
- std::size_t size = 256 * 1024; // 256 kB
- if ( boost::ctx::is_stack_unbound() )
- return std::max( size, boost::ctx::minimum_stacksize() );
-
- BOOST_ASSERT( boost::ctx::maximum_stacksize() >= boost::ctx::minimum_stacksize() );
- return boost::ctx::maximum_stacksize() == boost::ctx::minimum_stacksize()
- ? boost::ctx::minimum_stacksize()
- : std::min( size, boost::ctx::maximum_stacksize() );
-}
-
-}
-
-namespace boost {
-namespace ctx {
-
-BOOST_CONTEXT_DECL
-std::size_t pagesize()
-{
- static std::size_t size =
- static_cast< std::size_t >( system_info().dwPageSize);
- return size;
-}
-
-BOOST_CONTEXT_DECL
-std::size_t page_count( std::size_t stacksize)
-{
- return static_cast< std::size_t >(
- std::ceil(
- static_cast< float >( stacksize) / pagesize() ) );
-}
-
-// Windows seams not to provide a limit for the stacksize
-BOOST_CONTEXT_DECL
-bool is_stack_unbound()
-{ return true; }
-
-BOOST_CONTEXT_DECL
-std::size_t maximum_stacksize()
-{
- BOOST_ASSERT( ! is_stack_unbound() );
- static std::size_t size = 1 * 1024 * 1024 * 1024; // 1GB
- return size;
-}
-
-BOOST_CONTEXT_DECL
-std::size_t minimum_stacksize()
-{
- // space for guard page added
- static std::size_t size =
- static_cast< std::size_t >( system_info().dwAllocationGranularity)
- + pagesize();
- return size;
-}
-
-BOOST_CONTEXT_DECL
-std::size_t default_stacksize()
-{
- static std::size_t size = compute_default_stacksize_();
- return size;
-}
-
-}}
Modified: trunk/libs/context/test/test_context.cpp
==============================================================================
--- trunk/libs/context/test/test_context.cpp (original)
+++ trunk/libs/context/test/test_context.cpp 2012-09-03 13:06:56 EDT (Mon, 03 Sep 2012)
@@ -76,9 +76,9 @@
void test_stack_utils()
{
- if ( ! ctx::is_stack_unbound() )
- BOOST_CHECK( ctx::maximum_stacksize() >= ctx::default_stacksize() );
- BOOST_CHECK( ctx::default_stacksize() >= ctx::minimum_stacksize() );
+ if ( ! ctx::stack_allocator::is_stack_unbound() )
+ BOOST_CHECK( ctx::stack_allocator::maximum_stacksize() >= ctx::stack_allocator::default_stacksize() );
+ BOOST_CHECK( ctx::stack_allocator::default_stacksize() >= ctx::stack_allocator::minimum_stacksize() );
}
void test_start()
@@ -87,8 +87,8 @@
ctx::stack_allocator alloc;
- fc1.fc_stack.sp = alloc.allocate( ctx::minimum_stacksize() );
- fc1.fc_stack.size = ctx::minimum_stacksize();
+ fc1.fc_stack.sp = alloc.allocate( ctx::stack_allocator::minimum_stacksize() );
+ fc1.fc_stack.size = ctx::stack_allocator::minimum_stacksize();
ctx::make_fcontext( & fc1, f1);
BOOST_CHECK_EQUAL( 0, value1);
@@ -102,8 +102,8 @@
ctx::stack_allocator alloc;
- fc1.fc_stack.sp = alloc.allocate( ctx::minimum_stacksize() );
- fc1.fc_stack.size = ctx::minimum_stacksize();
+ fc1.fc_stack.sp = alloc.allocate( ctx::stack_allocator::minimum_stacksize() );
+ fc1.fc_stack.size = ctx::stack_allocator::minimum_stacksize();
ctx::make_fcontext( & fc1, f3);
BOOST_CHECK_EQUAL( 0, value1);
@@ -117,8 +117,8 @@
{
ctx::stack_allocator alloc;
- fc1.fc_stack.sp = alloc.allocate( ctx::minimum_stacksize() );
- fc1.fc_stack.size = ctx::minimum_stacksize();
+ fc1.fc_stack.sp = alloc.allocate( ctx::stack_allocator::minimum_stacksize() );
+ fc1.fc_stack.size = ctx::stack_allocator::minimum_stacksize();
ctx::make_fcontext( & fc1, f4);
int result = ( int) ctx::jump_fcontext( & fcm, & fc1, 0);
@@ -129,8 +129,8 @@
{
ctx::stack_allocator alloc;
- fc1.fc_stack.sp = alloc.allocate( ctx::minimum_stacksize() );
- fc1.fc_stack.size = ctx::minimum_stacksize();
+ fc1.fc_stack.sp = alloc.allocate( ctx::stack_allocator::minimum_stacksize() );
+ fc1.fc_stack.size = ctx::stack_allocator::minimum_stacksize();
int i = 7;
ctx::make_fcontext( & fc1, f5);
@@ -142,8 +142,8 @@
{
ctx::stack_allocator alloc;
- fc1.fc_stack.sp = alloc.allocate( ctx::minimum_stacksize() );
- fc1.fc_stack.size = ctx::minimum_stacksize();
+ fc1.fc_stack.sp = alloc.allocate( ctx::stack_allocator::minimum_stacksize() );
+ fc1.fc_stack.size = ctx::stack_allocator::minimum_stacksize();
std::pair< int, int > data = std::make_pair( 3, 7);
ctx::make_fcontext( & fc1, f6);
@@ -158,8 +158,8 @@
{
ctx::stack_allocator alloc;
- fc1.fc_stack.sp = alloc.allocate( ctx::minimum_stacksize() );
- fc1.fc_stack.size = ctx::minimum_stacksize();
+ fc1.fc_stack.sp = alloc.allocate( ctx::stack_allocator::minimum_stacksize() );
+ fc1.fc_stack.size = ctx::stack_allocator::minimum_stacksize();
const char * what = "hello world";
ctx::make_fcontext( & fc1, f7);
@@ -171,8 +171,8 @@
{
ctx::stack_allocator alloc;
- fc1.fc_stack.sp = alloc.allocate( ctx::minimum_stacksize() );
- fc1.fc_stack.size = ctx::minimum_stacksize();
+ fc1.fc_stack.sp = alloc.allocate( ctx::stack_allocator::minimum_stacksize() );
+ fc1.fc_stack.size = ctx::stack_allocator::minimum_stacksize();
double d = 7.13;
ctx::make_fcontext( & fc1, f8);
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