if (asg->hierarchy == SURF_ROUTING_RECURSIVE && !first
&& strcmp(gw_dst, prev_gw_src)) {
- xbt_dynar_t e_route_as_to_as=NULL;
+ xbt_dynar_t e_route_as_to_as;
+ e_route_as_to_as = xbt_dynar_new(global_routing->size_of_link, NULL);
routing_get_route_and_latency(gw_dst, prev_gw_src,&e_route_as_to_as,NULL);
links = e_route_as_to_as;
int pos = 0;
*lat += surf_network_model->extension.network.get_link_latency(link);
pos++;
}
+ xbt_dynar_free(&e_route_as_to_as);
}
links = e_route->link_list;
xbt_dict_free(&as->generic_routing.bypassRoutes);
/* Delete index dict */
xbt_dict_free(&(as->generic_routing.to_index));
- /* Delete dictionary index dict, predecessor and links table */
+ /* Delete predecessor and cost table */
xbt_free(as->predecessor_table);
+ xbt_free(as->cost_table);
model_generic_finalize(rc);
}
/* set the size of table routing */
size_t table_size = xbt_dict_length(rc->to_index);
int *src_id, *dst_id;
- int i,j;
src_id = xbt_dict_get_or_null(rc->to_index, src);
dst_id = xbt_dict_get_or_null(rc->to_index, dst);
if(!as->link_table)
{
+ int i,j;
/* Create Cost, Predecessor and Link tables */
as->cost_table = xbt_new0(double, table_size * table_size); /* link cost from host to host */
as->predecessor_table = xbt_new0(int, table_size * table_size); /* predecessor host numbers */