From: Martin Quinson Date: Fri, 4 Nov 2011 10:59:43 +0000 (+0100) Subject: no need to reset a struct that will be freed X-Git-Tag: exp_20120216~497 X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/commitdiff_plain/2dfa0bf9c35843676bc2bd0de023e3512083d38c no need to reset a struct that will be freed --- diff --git a/src/surf/surf_routing.c b/src/surf/surf_routing.c index cfdc4665c1..bfca2d488d 100644 --- a/src/surf/surf_routing.c +++ b/src/surf/surf_routing.c @@ -1617,24 +1617,11 @@ void routing_parse_Scluster(void) // XBT_INFO("key '%s' Value '%s'",host_id,link_id); ETag_surfxml_host(); xbt_free(struct_host->V_host_id); - struct_host->V_host_power_peak = 0.0; - struct_host->V_host_core = 0; - struct_host->V_host_power_scale = 0.0; - struct_host->V_host_state_initial = SURF_RESOURCE_ON; - struct_host->V_host_power_trace = NULL; - struct_host->V_host_state_trace = NULL; xbt_free(struct_host->V_host_coord); xbt_free(struct_host); ETag_surfxml_link(); xbt_free(struct_lnk->V_link_id); - struct_lnk->V_link_bandwidth = 0; - struct_lnk->V_link_bandwidth_file = NULL; - struct_lnk->V_link_latency = 0; - struct_lnk->V_link_latency_file = NULL; - struct_lnk->V_link_state = SURF_RESOURCE_ON; - struct_lnk->V_link_state_file = NULL; - struct_lnk->V_link_sharing_policy = 0; xbt_free(struct_lnk); break; @@ -1718,24 +1705,11 @@ void routing_parse_Scluster(void) ETag_surfxml_host(); xbt_free(struct_host->V_host_id); - struct_host->V_host_power_peak = 0.0; - struct_host->V_host_core = 0; - struct_host->V_host_power_scale = 0.0; - struct_host->V_host_state_initial = SURF_RESOURCE_ON; - struct_host->V_host_power_trace = NULL; - struct_host->V_host_state_trace = NULL; xbt_free(struct_host->V_host_coord); xbt_free(struct_host); ETag_surfxml_link(); xbt_free(struct_lnk->V_link_id); - struct_lnk->V_link_bandwidth = 0; - struct_lnk->V_link_bandwidth_file = NULL; - struct_lnk->V_link_latency = 0; - struct_lnk->V_link_latency_file = NULL; - struct_lnk->V_link_state = SURF_RESOURCE_ON; - struct_lnk->V_link_state_file = NULL; - struct_lnk->V_link_sharing_policy = 0; xbt_free(struct_lnk); } break; diff --git a/src/surf/surfxml_parse.c b/src/surf/surfxml_parse.c index 4c38b8d28a..582b6a63bd 100644 --- a/src/surf/surfxml_parse.c +++ b/src/surf/surfxml_parse.c @@ -319,7 +319,6 @@ void STag_surfxml_host_cluster(void){ } void ETag_surfxml_host(void){ surfxml_call_cb_functions(ETag_surfxml_host_cb_list); -// xbt_free(struct_host->V_host_id); } void STag_surfxml_router(void){ @@ -370,15 +369,7 @@ void ETag_surfxml_cluster(void){ xbt_free(struct_cluster->V_cluster_prefix); xbt_free(struct_cluster->V_cluster_suffix); xbt_free(struct_cluster->V_cluster_radical); - struct_cluster->S_cluster_power = 0; - struct_cluster->S_cluster_core = 0; - struct_cluster->S_cluster_bw = 0; - struct_cluster->S_cluster_lat = 0; - struct_cluster->S_cluster_bb_bw = 0; - struct_cluster->S_cluster_bb_lat = 0; xbt_free(struct_cluster->S_cluster_router_id); - struct_cluster->V_cluster_sharing_policy = 0; - struct_cluster->V_cluster_bb_sharing_policy = 0; xbt_free(struct_cluster); }