Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
cosmetics from patch review
[simgrid.git] / src / simix / smx_global.cpp
index bc31f71..9ba653b 100644 (file)
@@ -131,7 +131,7 @@ static void install_segvhandler(void)
   }
 
   struct sigaction action, old_action;
-  action.sa_sigaction = segvhandler;
+  action.sa_sigaction = &segvhandler;
   action.sa_flags = SA_ONSTACK | SA_RESETHAND | SA_SIGINFO;
   sigemptyset(&action.sa_mask);
 
@@ -205,9 +205,9 @@ void SIMIX_global_init(int *argc, char **argv)
     simix_global->maestro_process = NULL;
     simix_global->registered_functions = xbt_dict_new_homogeneous(NULL);
 
-    simix_global->create_process_function = SIMIX_process_create;
-    simix_global->kill_process_function = kill_process;
-    simix_global->cleanup_process_function = SIMIX_process_cleanup;
+    simix_global->create_process_function = &SIMIX_process_create;
+    simix_global->kill_process_function = &kill_process;
+    simix_global->cleanup_process_function = &SIMIX_process_cleanup;
     simix_global->mutex = xbt_os_mutex_init();
 
     surf_init(argc, argv);      /* Initialize SURF structures */
@@ -218,8 +218,8 @@ void SIMIX_global_init(int *argc, char **argv)
     simgrid::simix::create_maestro(maestro_code);
 
     /* context exception handlers */
-    __xbt_running_ctx_fetch = SIMIX_process_get_running_context;
-    __xbt_ex_terminate = SIMIX_process_exception_terminate;
+    __xbt_running_ctx_fetch = &SIMIX_process_get_running_context;
+    __xbt_ex_terminate = &SIMIX_process_exception_terminate;
 
     /* Prepare to display some more info when dying on Ctrl-C pressing */
     signal(SIGINT, inthandler);
@@ -298,8 +298,10 @@ void SIMIX_clean(void)
 
   /* Let's free maestro now */
   delete simix_global->maestro_process->context;
+  simix_global->maestro_process->context = nullptr;
   xbt_free(simix_global->maestro_process->running_ctx);
-  xbt_free(simix_global->maestro_process);
+  simix_global->maestro_process->running_ctx = nullptr;
+  delete simix_global->maestro_process;
   simix_global->maestro_process = NULL;
 
   /* Restore the default exception setup */
@@ -648,7 +650,7 @@ void SIMIX_display_process_status(void)
       XBT_INFO("Process %lu (%s@%s): waiting for %s synchro %p (%s) in state %d to finish",
           process->pid, process->name.c_str(), sg_host_get_name(process->host),
           synchro_description, process->waiting_synchro,
-          process->waiting_synchro->name, (int)process->waiting_synchro->state);
+          process->waiting_synchro->name.c_str(), (int)process->waiting_synchro->state);
     }
     else {
       XBT_INFO("Process %lu (%s@%s)", process->pid, process->name.c_str(), sg_host_get_name(process->host));