From c7c5def2870e604025be03b866967c0c5e293afe Mon Sep 17 00:00:00 2001 From: Arnaud Giersch Date: Sun, 4 Feb 2018 15:50:54 +0100 Subject: [PATCH] Revert "actually fix the memleak around smpi's process_data" and "try to plug a memleak" This reverts commit 3c40b1bfc4f4925fa401d3b5d0c74a4b4824b3d5 and commit d53a2108a1ea38b2f952abb48c39730ccc91c2a8. --- include/simgrid/s4u/Actor.hpp | 2 -- src/s4u/s4u_actor.cpp | 1 - src/simix/ActorImpl.cpp | 3 +-- src/smpi/internals/smpi_global.cpp | 7 ------- 4 files changed, 1 insertion(+), 12 deletions(-) diff --git a/include/simgrid/s4u/Actor.hpp b/include/simgrid/s4u/Actor.hpp index 147f538aa3..670f5022c9 100644 --- a/include/simgrid/s4u/Actor.hpp +++ b/include/simgrid/s4u/Actor.hpp @@ -165,8 +165,6 @@ public: /** Signal to others that a new actor has been created **/ static simgrid::xbt::signal onCreation; - /** Signal indicating that the given actor is about to disappear */ - static simgrid::xbt::signal onDestruction; /** Create an actor using a function * diff --git a/src/s4u/s4u_actor.cpp b/src/s4u/s4u_actor.cpp index a81f54a2e7..5e07894d8d 100644 --- a/src/s4u/s4u_actor.cpp +++ b/src/s4u/s4u_actor.cpp @@ -22,7 +22,6 @@ namespace simgrid { namespace s4u { simgrid::xbt::signal s4u::Actor::onCreation; -simgrid::xbt::signal s4u::Actor::onDestruction; // ***** Actor creation ***** ActorPtr Actor::self() diff --git a/src/simix/ActorImpl.cpp b/src/simix/ActorImpl.cpp index a1982608a4..935ca1b12b 100644 --- a/src/simix/ActorImpl.cpp +++ b/src/simix/ActorImpl.cpp @@ -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(); diff --git a/src/smpi/internals/smpi_global.cpp b/src/smpi/internals/smpi_global.cpp index 091dcb2652..5b0bab3ccf 100644 --- a/src/smpi/internals/smpi_global.cpp +++ b/src/smpi/internals/smpi_global.cpp @@ -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(); -- 2.20.1