#include "ContextBoost.hpp"
#include "simgrid/Exception.hpp"
+#include "src/internal_config.h"
#include "src/simix/smx_private.hpp"
XBT_LOG_EXTERNAL_DEFAULT_CATEGORY(simix_context);
BoostContext::BoostContext(std::function<void()>&& code, actor::ActorImpl* actor, SwappedContextFactory* factory)
: SwappedContext(std::move(code), actor, factory)
{
-
+ XBT_VERB("Creating a context of stack %uMb", actor->get_stacksize() / 1024 / 1024);
/* if the user provided a function for the process then use it, otherwise it is the context for maestro */
if (has_code()) {
#if BOOST_VERSION < 106100
- this->fc_ = boost::context::make_fcontext(get_stack_bottom(), smx_context_stack_size, BoostContext::wrapper);
+ this->fc_ = boost::context::make_fcontext(get_stack_bottom(), actor->get_stacksize(), BoostContext::wrapper);
#else
this->fc_ =
- boost::context::detail::make_fcontext(get_stack_bottom(), smx_context_stack_size, BoostContext::wrapper);
+ boost::context::detail::make_fcontext(get_stack_bottom(), actor->get_stacksize(), BoostContext::wrapper);
#endif
}
}
void BoostContext::swap_into_for_real(SwappedContext* to_)
{
- BoostContext* to = static_cast<BoostContext*>(to_);
+ auto* to = static_cast<BoostContext*>(to_);
#if BOOST_VERSION < 106100
boost::context::jump_fcontext(&this->fc_, to->fc_, reinterpret_cast<intptr_t>(to));
#else