X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/281f8c29e177852dcb1591fc31e363e1176857c8..83805c9c9180c1b65a20e169742375929ffaf87b:/src/surf/surf_routing_full.cpp diff --git a/src/surf/surf_routing_full.cpp b/src/surf/surf_routing_full.cpp index 9c74b224dd..02a5168776 100644 --- a/src/surf/surf_routing_full.cpp +++ b/src/surf/surf_routing_full.cpp @@ -5,11 +5,9 @@ * under the terms of the license (GNU LGPL) which comes with this package. */ #include "surf_routing_full.hpp" -#include "network.hpp" +#include "network_interface.hpp" -extern "C" { XBT_LOG_NEW_DEFAULT_SUBCATEGORY(surf_route_full, surf, "Routing part of surf"); -} /* Global vars */ extern routing_platf_t routing_platf; @@ -24,12 +22,12 @@ AS_t model_full_create(void) void model_full_end(AS_t _routing) { - unsigned int i; + int i; sg_platf_route_cbarg_t e_route; /* set utils vars */ AsFullPtr routing = ((AsFullPtr) _routing); - size_t table_size = xbt_dynar_length(routing->p_indexNetworkElm); + int table_size = (int)xbt_dynar_length(routing->p_indexNetworkElm); /* Create table if necessary */ if (!routing->p_routingTable) @@ -56,12 +54,16 @@ AsFull::AsFull(){ } AsFull::~AsFull(){ - size_t table_size = xbt_dynar_length(p_indexNetworkElm); + int table_size = (int)xbt_dynar_length(p_indexNetworkElm); int i, j; /* Delete routing table */ for (i = 0; i < table_size; i++) - for (j = 0; j < table_size; j++) - delete TO_ROUTE_FULL(i,j); + for (j = 0; j < table_size; j++) { + if (TO_ROUTE_FULL(i,j)){ + xbt_dynar_free(&TO_ROUTE_FULL(i,j)->link_list); + xbt_free(TO_ROUTE_FULL(i,j)); + } + } xbt_free(p_routingTable); } @@ -123,7 +125,7 @@ void AsFull::getRouteAndLatency(RoutingEdgePtr src, RoutingEdgePtr dst, sg_platf xbt_dynar_foreach(e_route->link_list, cpt, link) { xbt_dynar_push(res->link_list, &link); if (lat) - *lat += dynamic_cast(static_cast(link))->getLatency(); + *lat += static_cast(link)->getLatency(); } } }