Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Fix memory leaks
[simgrid.git] / src / surf / surf_routing.c
index 024ea27..62791d4 100644 (file)
@@ -863,6 +863,8 @@ static double _get_latency(const char *src, const char *dst)
   }
 
   xbt_dynar_free(&elem_father_list);
+  xbt_dynar_free(&e_route->generic_route.link_list);
+  xbt_free(e_route);
 
   return latency;
 }
@@ -944,6 +946,7 @@ static double get_latency(const char *src, const char *dst)
     latency = (*(common_father->get_latency)) (common_father, src, dst);
 
   xbt_assert2(latency>=0.0, "no route between \"%s\" and \"%s\"", src, dst);
+  xbt_dynar_free(&elem_father_list);
 
   return latency;
 }
@@ -2872,6 +2875,7 @@ static double generic_get_link_latency(routing_component_t rc,
        xbt_dynar_foreach(route->generic_route.link_list,i,link) {
                latency += get_link_latency(link);
        }
+       generic_free_extended_route(route);
   return latency;
 }
 
@@ -3241,6 +3245,7 @@ static void routing_parse_Scluster(void)
   char *cluster_suffix = A_surfxml_cluster_suffix;
   char *cluster_radical = A_surfxml_cluster_radical;
   char *cluster_power = A_surfxml_cluster_power;
+  char *cluster_core = A_surfxml_cluster_core;
   char *cluster_bw = A_surfxml_cluster_bw;
   char *cluster_lat = A_surfxml_cluster_lat;
   char *cluster_bb_bw = A_surfxml_cluster_bb_bw;
@@ -3297,6 +3302,7 @@ static void routing_parse_Scluster(void)
       A_surfxml_host_state = A_surfxml_host_state_ON;
       SURFXML_BUFFER_SET(host_id, host_id);
       SURFXML_BUFFER_SET(host_power, cluster_power);
+      SURFXML_BUFFER_SET(host_core, cluster_core);
       SURFXML_BUFFER_SET(host_availability, "1.0");
       SURFXML_BUFFER_SET(host_availability_file, "");
       SURFXML_BUFFER_SET(host_state_file, "");
@@ -3340,6 +3346,7 @@ static void routing_parse_Scluster(void)
         A_surfxml_host_state = A_surfxml_host_state_ON;
         SURFXML_BUFFER_SET(host_id, host_id);
         SURFXML_BUFFER_SET(host_power, cluster_power);
+        SURFXML_BUFFER_SET(host_core, cluster_core);
         SURFXML_BUFFER_SET(host_availability, "1.0");
         SURFXML_BUFFER_SET(host_availability_file, "");
         SURFXML_BUFFER_SET(host_state_file, "");
@@ -3632,8 +3639,6 @@ static void routing_parse_Speer(void)
   A_surfxml_link_sharing_policy = A_surfxml_link_sharing_policy_SHARED;
   if(peer_sharing_policy == A_surfxml_peer_sharing_policy_FULLDUPLEX)
 {A_surfxml_link_sharing_policy =  A_surfxml_link_sharing_policy_FULLDUPLEX;}
-  if(peer_sharing_policy == A_surfxml_peer_sharing_policy_FATPIPE)
-{A_surfxml_link_sharing_policy =  A_surfxml_link_sharing_policy_FATPIPE;}
   SURFXML_BUFFER_SET(link_id, link_id_up);
   SURFXML_BUFFER_SET(link_bandwidth, peer_bw_in);
   SURFXML_BUFFER_SET(link_latency, peer_lat);
@@ -3648,8 +3653,6 @@ static void routing_parse_Speer(void)
   A_surfxml_link_sharing_policy = A_surfxml_link_sharing_policy_SHARED;
   if(peer_sharing_policy == A_surfxml_cluster_sharing_policy_FULLDUPLEX)
 {A_surfxml_link_sharing_policy =  A_surfxml_link_sharing_policy_FULLDUPLEX;}
-  if(peer_sharing_policy == A_surfxml_peer_sharing_policy_FATPIPE)
-{A_surfxml_link_sharing_policy =  A_surfxml_link_sharing_policy_FATPIPE;}
   SURFXML_BUFFER_SET(link_id, link_id_down);
   SURFXML_BUFFER_SET(link_bandwidth, peer_bw_out);
   SURFXML_BUFFER_SET(link_latency, peer_lat);