X-Git-Url: http://bilbo.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/8e7feffef5e41a487cc322c68265c09cc0d7bdf2..b2852b7c61948f495d7437ffaa7fd9aced12849c:/src/kernel/context/ContextBoost.cpp diff --git a/src/kernel/context/ContextBoost.cpp b/src/kernel/context/ContextBoost.cpp index 9d275c2d3c..8f3a9e4b34 100644 --- a/src/kernel/context/ContextBoost.cpp +++ b/src/kernel/context/ContextBoost.cpp @@ -1,17 +1,15 @@ -/* Copyright (c) 2015-2020. The SimGrid Team. All rights reserved. */ +/* Copyright (c) 2015-2023. The SimGrid Team. All rights reserved. */ /* This program is free software; you can redistribute it and/or modify it * under the terms of the license (GNU LGPL) which comes with this package. */ #include "ContextBoost.hpp" #include "simgrid/Exception.hpp" -#include "src/simix/smx_private.hpp" +#include "src/internal_config.h" -XBT_LOG_EXTERNAL_DEFAULT_CATEGORY(simix_context); +XBT_LOG_EXTERNAL_DEFAULT_CATEGORY(ker_context); -namespace simgrid { -namespace kernel { -namespace context { +namespace simgrid::kernel::context { // BoostContextFactory BoostContext* BoostContextFactory::create_context(std::function&& code, actor::ActorImpl* actor) @@ -24,14 +22,14 @@ BoostContext* BoostContextFactory::create_context(std::function&& code, BoostContext::BoostContext(std::function&& 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 } } @@ -50,7 +48,7 @@ void BoostContext::wrapper(BoostContext::arg_type arg) void BoostContext::swap_into_for_real(SwappedContext* to_) { - BoostContext* to = static_cast(to_); + auto* to = static_cast(to_); #if BOOST_VERSION < 106100 boost::context::jump_fcontext(&this->fc_, to->fc_, reinterpret_cast(to)); #else @@ -66,6 +64,4 @@ XBT_PRIVATE ContextFactory* boost_factory() XBT_VERB("Using Boost contexts. Welcome to the 21th century."); return new BoostContextFactory(); } -} // namespace context -} // namespace kernel -} // namespace simgrid +} // namespace simgrid::kernel::context