X-Git-Url: http://bilbo.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/02a0b077329593921105001a7f27463ba2d82ced..b2852b7c61948f495d7437ffaa7fd9aced12849c:/src/kernel/context/ContextSwapped.cpp diff --git a/src/kernel/context/ContextSwapped.cpp b/src/kernel/context/ContextSwapped.cpp index a19779195b..aff10af720 100644 --- a/src/kernel/context/ContextSwapped.cpp +++ b/src/kernel/context/ContextSwapped.cpp @@ -9,7 +9,7 @@ #include "src/kernel/EngineImpl.hpp" #include "src/kernel/actor/ActorImpl.hpp" #include "src/sthread/sthread.h" -#include "xbt/parmap.hpp" +#include "src/xbt/parmap.hpp" #include "src/kernel/context/ContextSwapped.hpp" @@ -82,17 +82,9 @@ SwappedContext::SwappedContext(std::function&& code, actor::ActorImpl* a #endif size_t size = actor->get_stacksize() + guard_size; -#if SIMGRID_HAVE_MC - /* Cannot use posix_memalign when SIMGRID_HAVE_MC. Align stack by hand, and save the - * pointer returned by xbt_malloc0. */ - auto* alloc = static_cast(xbt_malloc0(size + xbt_pagesize)); - stack_ = alloc - (reinterpret_cast(alloc) & (xbt_pagesize - 1)) + xbt_pagesize; - reinterpret_cast(stack_)[-1] = alloc; -#else void* alloc; xbt_assert(posix_memalign(&alloc, xbt_pagesize, size) == 0, "Failed to allocate stack."); this->stack_ = static_cast(alloc); -#endif /* This is fatal. We are going to fail at some point when we try reusing this. */ xbt_assert( @@ -146,10 +138,6 @@ SwappedContext::~SwappedContext() XBT_WARN("Failed to remove page protection: %s", strerror(errno)); /* try to pursue anyway */ } -#if SIMGRID_HAVE_MC - /* Retrieve the saved pointer. See the initialization above. */ - stack_ = reinterpret_cast(stack_)[-1]; -#endif } xbt_free(stack_);