Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Cosmetics.
authorArnaud Giersch <arnaud.giersch@univ-fcomte.fr>
Mon, 21 Jan 2019 11:09:21 +0000 (12:09 +0100)
committerArnaud Giersch <arnaud.giersch@univ-fcomte.fr>
Mon, 21 Jan 2019 14:35:58 +0000 (15:35 +0100)
src/kernel/context/ContextSwapped.cpp
src/kernel/context/ContextUnix.cpp

index 7775167..100dcba 100644 (file)
@@ -40,14 +40,11 @@ thread_local uintptr_t SwappedContext::worker_id_;             /* thread-specifi
 SwappedContextFactory::SwappedContextFactory() : ContextFactory(), parallel_(SIMIX_context_is_parallel())
 {
   parmap_ = nullptr; // will be created lazily with the right parameters if needed (ie, in parallel)
 SwappedContextFactory::SwappedContextFactory() : ContextFactory(), parallel_(SIMIX_context_is_parallel())
 {
   parmap_ = nullptr; // will be created lazily with the right parameters if needed (ie, in parallel)
-  workers_context_.clear();
   workers_context_.resize(parallel_ ? SIMIX_context_get_nthreads() : 1, nullptr);
 }
 SwappedContextFactory::~SwappedContextFactory()
 {
   delete parmap_;
   workers_context_.resize(parallel_ ? SIMIX_context_get_nthreads() : 1, nullptr);
 }
 SwappedContextFactory::~SwappedContextFactory()
 {
   delete parmap_;
-  parmap_ = nullptr;
-  workers_context_.clear();
 }
 
 SwappedContext::SwappedContext(std::function<void()> code, void_pfn_smxprocess_t cleanup_func, smx_actor_t process,
 }
 
 SwappedContext::SwappedContext(std::function<void()> code, void_pfn_smxprocess_t cleanup_func, smx_actor_t process,
index 09711d0..3042e2f 100644 (file)
@@ -86,13 +86,13 @@ UContext::UContext(std::function<void()> code, void_pfn_smxprocess_t cleanup_fun
     UContext* arg = this;
     memcpy(ctx_addr, &arg, sizeof this);
     makecontext(&this->uc_, (void (*)())smx_ctx_wrapper, 2, ctx_addr[0], ctx_addr[1]);
     UContext* arg = this;
     memcpy(ctx_addr, &arg, sizeof this);
     makecontext(&this->uc_, (void (*)())smx_ctx_wrapper, 2, ctx_addr[0], ctx_addr[1]);
-  }
 
 #if SIMGRID_HAVE_MC
 
 #if SIMGRID_HAVE_MC
-  if (MC_is_active() && has_code()) {
-    MC_register_stack_area(get_stack(), actor, &(this->uc_), smx_context_usable_stack_size);
-  }
+    if (MC_is_active()) {
+      MC_register_stack_area(get_stack(), actor, &(this->uc_), smx_context_usable_stack_size);
+    }
 #endif
 #endif
+  }
 }
 
 void UContext::swap_into(SwappedContext* to_)
 }
 
 void UContext::swap_into(SwappedContext* to_)