Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Revert "actually fix the memleak around smpi's process_data" and "try to plug a memleak"
authorArnaud Giersch <arnaud.giersch@univ-fcomte.fr>
Sun, 4 Feb 2018 14:50:54 +0000 (15:50 +0100)
committerArnaud Giersch <arnaud.giersch@univ-fcomte.fr>
Mon, 5 Feb 2018 10:19:31 +0000 (11:19 +0100)
This reverts commit 3c40b1bfc4f4925fa401d3b5d0c74a4b4824b3d5
and commit d53a2108a1ea38b2f952abb48c39730ccc91c2a8.

include/simgrid/s4u/Actor.hpp
src/s4u/s4u_actor.cpp
src/simix/ActorImpl.cpp
src/smpi/internals/smpi_global.cpp

index 147f538..670f502 100644 (file)
@@ -165,8 +165,6 @@ public:
 
   /** Signal to others that a new actor has been created **/
   static simgrid::xbt::signal<void(simgrid::s4u::ActorPtr)> onCreation;
-  /** Signal indicating that the given actor is about to disappear */
-  static simgrid::xbt::signal<void(simgrid::s4u::ActorPtr)> onDestruction;
 
   /** Create an actor using a function
    *
index a81f54a..5e07894 100644 (file)
@@ -22,7 +22,6 @@ namespace simgrid {
 namespace s4u {
 
 simgrid::xbt::signal<void(simgrid::s4u::ActorPtr)> s4u::Actor::onCreation;
-simgrid::xbt::signal<void(simgrid::s4u::ActorPtr)> s4u::Actor::onDestruction;
 
 // ***** Actor creation *****
 ActorPtr Actor::self()
index a198260..935ca1b 100644 (file)
@@ -404,7 +404,6 @@ smx_actor_t SIMIX_process_attach(const char* name, void* data, const char* hostn
   simix_global->process_list[process->pid] = process;
   XBT_DEBUG("Inserting %s(%s) in the to_run list", process->getCname(), host->getCname());
   simix_global->process_to_run.push_back(process);
-  intrusive_ptr_add_ref(process);
 
   /* Tracing the process creation */
   TRACE_msg_process_create(process->getName(), process->pid, process->host);
@@ -426,6 +425,7 @@ void SIMIX_process_detach()
   auto process = context->process();
   simix_global->cleanup_process_function(process);
   context->attach_stop();
+  delete process;
 }
 
 /**
@@ -783,7 +783,6 @@ smx_actor_t SIMIX_process_from_PID(aid_t PID)
 }
 
 void SIMIX_process_on_exit_runall(smx_actor_t process) {
-  simgrid::s4u::Actor::onDestruction(process->iface());
   smx_process_exit_status_t exit_status = (process->context->iwannadie) ? SMX_EXIT_FAILURE : SMX_EXIT_SUCCESS;
   while (not process->on_exit.empty()) {
     s_smx_process_exit_fun_t exit_fun = process->on_exit.back();
index 091dcb2..5b0bab3 100644 (file)
@@ -623,13 +623,6 @@ void SMPI_init(){
   simgrid::s4u::Actor::onCreation.connect([](simgrid::s4u::ActorPtr actor) {
     process_data.insert({actor, new simgrid::smpi::Process(actor, nullptr)});
   });
-  simgrid::s4u::Actor::onDestruction.connect([](simgrid::s4u::ActorPtr actor) {
-    if (process_data.find(actor) != process_data.end()) {
-      delete process_data.at(actor);
-      process_data.erase(actor);
-    }
-  });
-
   smpi_init_options();
   smpi_global_init();
   smpi_check_options();