X-Git-Url: http://bilbo.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/9a4ec91cc24a9a54ff3a060cc2828ac54d0c0c26..5f5a10db6fc4552782638abb4817041223e17775:/src/kernel/context/ContextSwapped.cpp diff --git a/src/kernel/context/ContextSwapped.cpp b/src/kernel/context/ContextSwapped.cpp index 1f3cd31e3a..aff10af720 100644 --- a/src/kernel/context/ContextSwapped.cpp +++ b/src/kernel/context/ContextSwapped.cpp @@ -82,17 +82,9 @@ SwappedContext::SwappedContext(std::function&& code, actor::ActorImpl* a #endif size_t size = actor->get_stacksize() + guard_size; -#if SIMGRID_HAVE_STATEFUL_MC - /* Cannot use posix_memalign when SIMGRID_HAVE_STATEFUL_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_STATEFUL_MC - /* Retrieve the saved pointer. See the initialization above. */ - stack_ = reinterpret_cast(stack_)[-1]; -#endif } xbt_free(stack_);