From: Martin Quinson Date: Wed, 14 Sep 2016 19:43:42 +0000 (+0200) Subject: another dynar dies X-Git-Tag: v3_14~403 X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/commitdiff_plain/65ad88b71f10717fb542633b394035ff2e53e308?hp=3109acfa21fc51d0227ce2e14562ddc7f2c0fca9 another dynar dies --- diff --git a/src/simix/smx_host.cpp b/src/simix/smx_host.cpp index 7eaf2bb054..9537df48ea 100644 --- a/src/simix/smx_host.cpp +++ b/src/simix/smx_host.cpp @@ -49,7 +49,9 @@ namespace simgrid { for (auto arg : auto_restart_processes) delete arg; auto_restart_processes.clear(); - xbt_dynar_free(&boot_processes); + for (auto arg : boot_processes) + delete arg; + boot_processes.clear(); xbt_swag_free(process_list); } @@ -59,9 +61,7 @@ namespace simgrid { */ void Host::turnOn() { - unsigned int cpt; - smx_process_arg_t arg; - xbt_dynar_foreach(boot_processes,cpt,arg) { + for (auto arg : boot_processes) { XBT_DEBUG("Booting Process %s(%s) right now", arg->name.c_str(), arg->hostname); simix_global->create_process_function(arg->name.c_str(), arg->code, diff --git a/src/simix/smx_host_private.h b/src/simix/smx_host_private.h index 7d3fd3d412..964a730050 100644 --- a/src/simix/smx_host_private.h +++ b/src/simix/smx_host_private.h @@ -32,7 +32,7 @@ namespace simgrid { xbt_swag_t process_list; std::vector auto_restart_processes; - xbt_dynar_t boot_processes = nullptr; + std::vector boot_processes; void turnOn(); }; diff --git a/src/surf/sg_platf.cpp b/src/surf/sg_platf.cpp index 5bfa669fe3..dfcb753bdc 100644 --- a/src/surf/sg_platf.cpp +++ b/src/surf/sg_platf.cpp @@ -595,10 +595,8 @@ void sg_platf_new_process(sg_platf_process_cbarg_t process) arg->hostname = sg_host_get_name(host); arg->kill_time = kill_time; arg->properties = current_property_set; - if (!sg_host_simix(host)->boot_processes) - sg_host_simix(host)->boot_processes = xbt_dynar_new(sizeof(smx_process_arg_t), _SIMIX_host_free_process_arg); - xbt_dynar_push_as(sg_host_simix(host)->boot_processes,smx_process_arg_t,arg); + sg_host_simix(host)->boot_processes.push_back(arg); if (start_time > SIMIX_get_clock()) {