From: Frederic Suter Date: Thu, 4 Feb 2016 14:14:05 +0000 (+0100) Subject: leak plug and cosmetics X-Git-Tag: v3_13~980 X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/commitdiff_plain/40cdb6e442e7e899fa85fc3d08dcbf4ec7ed9b75 leak plug and cosmetics --- diff --git a/src/simgrid/host.cpp b/src/simgrid/host.cpp index 94def06371..031e452ce5 100644 --- a/src/simgrid/host.cpp +++ b/src/simgrid/host.cpp @@ -61,15 +61,15 @@ sg_host_t sg_host_by_name_or_create(const char *name) xbt_dynar_t sg_hosts_as_dynar(void) { - xbt_dynar_t res = xbt_dynar_new(sizeof(sg_host_t),NULL); + xbt_dynar_t res = xbt_dynar_new(sizeof(sg_host_t),NULL); xbt_dict_cursor_t cursor = nullptr; const char* name = nullptr; simgrid::s4u::Host* host = nullptr; - xbt_dict_foreach(host_list, cursor, name, host) - if(routing_get_network_element_type(name) == SURF_NETWORK_ELEMENT_HOST) - xbt_dynar_push(res, &host); - return res; + xbt_dict_foreach(host_list, cursor, name, host) + if(routing_get_network_element_type(name) == SURF_NETWORK_ELEMENT_HOST) + xbt_dynar_push(res, &host); + return res; } // ========= Layering madness ==============* diff --git a/src/surf/cpu_interface.cpp b/src/surf/cpu_interface.cpp index 475e236447..a8572984a7 100644 --- a/src/surf/cpu_interface.cpp +++ b/src/surf/cpu_interface.cpp @@ -185,6 +185,8 @@ Cpu::~Cpu() } if (p_constraintCoreId) xbt_free(p_constraintCoreId); + if (p_speedPeakList) + xbt_dynar_free(&p_speedPeakList); } double Cpu::getCurrentPowerPeak() diff --git a/src/surf/host_ptask_L07.cpp b/src/surf/host_ptask_L07.cpp index 9197c4d277..eab2dddef8 100644 --- a/src/surf/host_ptask_L07.cpp +++ b/src/surf/host_ptask_L07.cpp @@ -283,6 +283,7 @@ L07Action::L07Action(Model *model, int host_nb, this->setCost(1.0); this->setRemains(0.0); } + xbt_free(host_list); } Action *NetworkL07Model::communicate(NetCard *src, NetCard *dst, @@ -594,7 +595,7 @@ int L07Action::unref() m_refcount--; if (!m_refcount) { if (action_hook.is_linked()) - p_stateSet->erase(p_stateSet->iterator_to(*this)); + p_stateSet->erase(p_stateSet->iterator_to(*this)); if (getVariable()) lmm_variable_free(getModel()->getMaxminSystem(), getVariable()); delete this;