A
lgorithmique
N
umérique
D
istribuée
Public GIT Repository
projects
/
simgrid.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Fix a bug
[simgrid.git]
/
src
/
surf
/
surf_routing_full.cpp
diff --git
a/src/surf/surf_routing_full.cpp
b/src/surf/surf_routing_full.cpp
index
9c74b22
..
02a5168
100644
(file)
--- 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"
* 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");
XBT_LOG_NEW_DEFAULT_SUBCATEGORY(surf_route_full, surf, "Routing part of surf");
-}
/* Global vars */
extern routing_platf_t routing_platf;
/* 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)
{
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);
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)
/* Create table if necessary */
if (!routing->p_routingTable)
@@
-56,12
+54,16
@@
AsFull::AsFull(){
}
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++)
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);
}
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)
xbt_dynar_foreach(e_route->link_list, cpt, link) {
xbt_dynar_push(res->link_list, &link);
if (lat)
- *lat +=
dynamic_cast<NetworkCm02LinkPtr>(static_cast<ResourcePtr>(link)
)->getLatency();
+ *lat +=
static_cast<NetworkLinkPtr>(link
)->getLatency();
}
}
}
}
}
}