X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/4e46fb705a7ae3d90e14ea3b9a0cc9b4e9007f99..0d8e66239690b90dd2ced42f6bacab683661b20f:/src/kernel/context/ContextBoost.cpp diff --git a/src/kernel/context/ContextBoost.cpp b/src/kernel/context/ContextBoost.cpp index 4298641e5c..9717474bc6 100644 --- a/src/kernel/context/ContextBoost.cpp +++ b/src/kernel/context/ContextBoost.cpp @@ -15,14 +15,14 @@ namespace kernel { namespace context { // BoostContextFactory -smx_context_t BoostContextFactory::create_context(std::function code, smx_actor_t actor) +smx_context_t BoostContextFactory::create_context(std::function&& code, smx_actor_t actor) { return this->new_context(std::move(code), actor, this); } // BoostContext -BoostContext::BoostContext(std::function code, smx_actor_t actor, SwappedContextFactory* factory) +BoostContext::BoostContext(std::function&& code, smx_actor_t actor, SwappedContextFactory* factory) : SwappedContext(std::move(code), actor, factory) { @@ -31,14 +31,14 @@ BoostContext::BoostContext(std::function code, smx_actor_t actor, Swappe /* We need to pass the bottom of the stack to make_fcontext, depending on the stack direction it may be the lower or higher address: */ #if PTH_STACKGROWTH == -1 - void* stack = static_cast(get_stack()) + smx_context_usable_stack_size; + unsigned char* stack = get_stack() + smx_context_stack_size; #else - void* stack = get_stack(); + unsigned char* stack = get_stack(); #endif #if BOOST_VERSION < 106100 - this->fc_ = boost::context::make_fcontext(stack, smx_context_usable_stack_size, BoostContext::wrapper); + this->fc_ = boost::context::make_fcontext(stack, smx_context_stack_size, BoostContext::wrapper); #else - this->fc_ = boost::context::detail::make_fcontext(stack, smx_context_usable_stack_size, BoostContext::wrapper); + this->fc_ = boost::context::detail::make_fcontext(stack, smx_context_stack_size, BoostContext::wrapper); #endif } else {