Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
cleanups to please sonar, and add a FIXME for a bug we have
[simgrid.git] / src / surf / sg_platf.cpp
index 776ab7a..7c8b90e 100644 (file)
@@ -95,11 +95,11 @@ static simgrid::kernel::routing::AsImpl* routing_get_current()
 }
 
 /** Module management function: creates all internal data structures */
-void sg_platf_init(void) {
+void sg_platf_init() {
 }
 
 /** Module management function: frees all internal data structures */
-void sg_platf_exit(void) {
+void sg_platf_exit() {
   simgrid::surf::on_link.disconnect_all_slots();
   simgrid::surf::on_cluster.disconnect_all_slots();
   simgrid::surf::on_postparse.disconnect_all_slots();
@@ -301,13 +301,12 @@ void sg_platf_new_cluster(sg_platf_cluster_cbarg_t cluster)
       }
     }
 
-    host.speed_per_pstate = xbt_dynar_new(sizeof(double), nullptr);
-    xbt_dynar_push(host.speed_per_pstate,&cluster->speed);
+    host.speed_per_pstate = new std::vector<double>();
+    host.speed_per_pstate->push_back(cluster->speed);
     host.pstate = 0;
     host.core_amount = cluster->core_amount;
     host.coord = "";
     sg_platf_new_host(&host);
-    xbt_dynar_free(&host.speed_per_pstate);
     XBT_DEBUG("</host>");
 
     XBT_DEBUG("<link\tid=\"%s\"\tbw=\"%f\"\tlat=\"%f\"/>", link_id, cluster->bw, cluster->lat);
@@ -422,10 +421,10 @@ void sg_platf_new_cabinet(sg_platf_cabinet_cbarg_t cabinet)
     host.pstate           = 0;
     host.core_amount      = 1;
     host.id               = hostname;
-    host.speed_per_pstate = xbt_dynar_new(sizeof(double), nullptr);
-    xbt_dynar_push(host.speed_per_pstate,&cabinet->speed);
+    host.speed_per_pstate = new std::vector<double>();
+    host.speed_per_pstate->push_back(cabinet->speed);
     sg_platf_new_host(&host);
-    xbt_dynar_free(&host.speed_per_pstate);
+    delete host.speed_per_pstate;
 
     s_sg_platf_link_cbarg_t link;
     memset(&link, 0, sizeof(link));
@@ -667,14 +666,14 @@ void sg_platf_new_peer(sg_platf_peer_cbarg_t peer)
   memset(&host, 0, sizeof(host));
   host.id = host_id;
 
-  host.speed_per_pstate = xbt_dynar_new(sizeof(double), nullptr);
-  xbt_dynar_push(host.speed_per_pstate,&peer->speed);
+  host.speed_per_pstate = new std::vector<double>();
+  host.speed_per_pstate->push_back(peer->speed);
   host.pstate = 0;
   host.speed_trace = peer->availability_trace;
   host.state_trace = peer->state_trace;
   host.core_amount = 1;
   sg_platf_new_host(&host);
-  xbt_dynar_free(&host.speed_per_pstate);
+  delete host.speed_per_pstate;
 
   s_sg_platf_link_cbarg_t link;
   memset(&link, 0, sizeof(link));