From: Paul Bédaride Date: Mon, 25 Nov 2013 16:55:51 +0000 (+0100) Subject: Fix Memleaks X-Git-Tag: v3_11_beta~220 X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/commitdiff_plain/2f2ce19fcb66a634c19de8dda2dc4b4896203537 Fix Memleaks --- diff --git a/src/instr/instr_interface.c b/src/instr/instr_interface.c index 170ebb12bb..31be78475f 100644 --- a/src/instr/instr_interface.c +++ b/src/instr/instr_interface.c @@ -11,8 +11,6 @@ #include "surf/surf.h" #include "surf/surf_private.h" -//FIXME:#include "surf/network_private.h" - typedef enum { INSTR_US_DECLARE, INSTR_US_SET, diff --git a/src/surf/instr_routing.c b/src/surf/instr_routing.c index 35a0118ef6..fd095a1c55 100644 --- a/src/surf/instr_routing.c +++ b/src/surf/instr_routing.c @@ -8,7 +8,6 @@ #ifdef HAVE_TRACING #include "surf/surf_private.h" -//FIXME:#include "surf/network_private.h" #include "xbt/graph.h" XBT_LOG_NEW_DEFAULT_SUBCATEGORY (instr_routing, instr, "Tracing platform hierarchy"); diff --git a/src/surf/surf.cpp b/src/surf/surf.cpp index f0230a025c..ee63af42ff 100644 --- a/src/surf/surf.cpp +++ b/src/surf/surf.cpp @@ -667,8 +667,9 @@ Resource::Resource(surf_model_t model, const char *name, xbt_dict_t props) : m_name(xbt_strdup(name)), m_properties(props), p_model(model), m_running(true) {} -Resource::Resource(){ -} +Resource::Resource() +: m_name(NULL), m_properties(NULL), p_model(NULL) +{} const char *Resource::getName() { diff --git a/src/surf/surf.hpp b/src/surf/surf.hpp index aaafa54524..770c293689 100644 --- a/src/surf/surf.hpp +++ b/src/surf/surf.hpp @@ -169,7 +169,7 @@ public: Resource(ModelPtr model, const char *name, xbt_dict_t properties); virtual ~Resource() { xbt_free((void*)m_name); - xbt_dict_free(&m_properties); + xbt_dict_free(&m_properties); }; virtual void updateState(tmgr_trace_event_t event_type, double value, double date)=0; diff --git a/src/surf/surf_routing.cpp b/src/surf/surf_routing.cpp index 6216697e01..cb3672ceff 100644 --- a/src/surf/surf_routing.cpp +++ b/src/surf/surf_routing.cpp @@ -542,7 +542,7 @@ static void _get_route_and_latency(RoutingEdgePtr src, RoutingEdgePtr dst, /* Common ancestor is kind enough to declare a bypass route from src to dst -- use it and bail out */ if (e_route_bypass) { xbt_dynar_merge(links, &e_route_bypass->link_list); - //FIXME:generic_free_route(e_route_bypass); + generic_free_route(e_route_bypass); return; } diff --git a/src/surf/surf_routing.hpp b/src/surf/surf_routing.hpp index 0f73c60b24..d0ae19bf62 100644 --- a/src/surf/surf_routing.hpp +++ b/src/surf/surf_routing.hpp @@ -29,14 +29,6 @@ typedef Onelink *OnelinkPtr; class RoutingPlatf; typedef RoutingPlatf *RoutingPlatfPtr; - -/*FIXME:class RoutingModelDescription { - const char *p_name; - const char *p_desc; - AsPtr create(); - void end(AsPtr as); -};*/ - struct As { public: xbt_dynar_t p_indexNetworkElm; diff --git a/src/surf/workstation.cpp b/src/surf/workstation.cpp index 67038479b3..ea90f8b98b 100644 --- a/src/surf/workstation.cpp +++ b/src/surf/workstation.cpp @@ -10,8 +10,6 @@ XBT_LOG_NEW_DEFAULT_SUBCATEGORY(surf_workstation, surf, WorkstationModelPtr surf_workstation_model = NULL; -//FIXME:Faire hériter ou composer de cup et network - /************* * CallBacks * *************/ diff --git a/src/surf/workstation.hpp b/src/surf/workstation.hpp index 126757d4bf..8ce487e30a 100644 --- a/src/surf/workstation.hpp +++ b/src/surf/workstation.hpp @@ -22,8 +22,8 @@ typedef WorkstationCLM03Lmm *WorkstationCLM03LmmPtr; class WorkstationAction; typedef WorkstationAction *WorkstationActionPtr; -/*FIXME:class WorkstationActionLmm; -typedef WorkstationActionLmm *WorkstationActionLmmPtr;*/ +class WorkstationActionLmm; +typedef WorkstationActionLmm *WorkstationActionLmmPtr; /********* * Tools * diff --git a/src/surf/workstation_ptask_L07.cpp b/src/surf/workstation_ptask_L07.cpp index 3f9e00eefc..d4d810a133 100644 --- a/src/surf/workstation_ptask_L07.cpp +++ b/src/surf/workstation_ptask_L07.cpp @@ -257,7 +257,7 @@ ResourcePtr WorkstationL07Model::createResource(const char *name, double /*power "Host '%s' declared several times in the platform file.", name); - wk = new WorkstationL07(this, name, cpu_properties, + wk = new WorkstationL07(this, name, NULL, static_cast(xbt_lib_get_or_null(host_lib, name, ROUTING_HOST_LEVEL)), dynamic_cast(static_cast(xbt_lib_get_or_null(host_lib, name, SURF_CPU_LEVEL)))); diff --git a/src/surf/workstation_ptask_L07.hpp b/src/surf/workstation_ptask_L07.hpp index 043404a8af..19ca9864bc 100644 --- a/src/surf/workstation_ptask_L07.hpp +++ b/src/surf/workstation_ptask_L07.hpp @@ -28,9 +28,6 @@ typedef LinkL07 *LinkL07Ptr; class WorkstationL07ActionLmm; typedef WorkstationL07ActionLmm *WorkstationL07ActionLmmPtr; -/*FIXME:class WorkstationActionLmm; -typedef WorkstationActionLmm *WorkstationActionLmmPtr;*/ - /********* * Tools * *********/