2
0
mirror of https://github.com/boostorg/context.git synced 2026-01-30 19:52:17 +00:00

context: merge from trunk (replace align_stack() by assembler; remove stack-allocator)

[SVN r81611]
This commit is contained in:
Oliver Kowalke
2012-11-28 07:52:08 +00:00
parent f6f764c25e
commit 56c47f24d5
33 changed files with 353 additions and 1143 deletions

View File

@@ -13,8 +13,16 @@
#include <boost/assert.hpp>
#include <boost/context/all.hpp>
#include "simple_stack_allocator.hpp"
namespace ctx = boost::context;
typedef ctx::simple_stack_allocator<
8 * 1024 * 1024, // 8MB
64 * 1024, // 64kB
8 * 1024 // 8kB
> stack_allocator;
ctx::fcontext_t fcm;
ctx::fcontext_t * fc1;
@@ -31,11 +39,10 @@ void f1( intptr_t param)
int main( int argc, char * argv[])
{
typedef ctx::simple_stack_allocator< 256 * 1024, 64 * 1024, 8 * 1024 > alloc_t;
alloc_t alloc;
stack_allocator alloc;
void * sp = alloc.allocate(alloc_t::default_stacksize());
fc1 = ctx::make_fcontext( sp, alloc_t::default_stacksize(), f1);
void * sp = alloc.allocate( stack_allocator::default_stacksize() );
fc1 = ctx::make_fcontext( sp, stack_allocator::default_stacksize(), f1);
pair_t p( std::make_pair( 2, 7) );
int res = ( int) ctx::jump_fcontext( & fcm, fc1, ( intptr_t) & p);