Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
[simix] Remove SIMIX_process_create_from_wrapper()
authorGabriel Corona <gabriel.corona@loria.fr>
Fri, 20 May 2016 08:00:19 +0000 (10:00 +0200)
committerGabriel Corona <gabriel.corona@loria.fr>
Mon, 23 May 2016 07:05:21 +0000 (09:05 +0200)
src/simix/smx_process.cpp
src/simix/smx_process_private.h
src/surf/sg_platf.cpp

index f696d92..54d6932 100644 (file)
@@ -201,29 +201,6 @@ void SIMIX_process_stop(smx_process_t arg) {
   arg->context->stop();
 }
 
-/**
- * \brief Same as SIMIX_process_create() but with only one argument (used by timers).
- * This function frees the argument.
- * \return the process created
- */
-smx_process_t SIMIX_process_create_from_wrapper(smx_process_arg_t args) {
-
-  smx_process_t process = simix_global->create_process_function(
-                                        args->name,
-                                        args->code,
-                                        args->data,
-                                        args->hostname,
-                                        args->kill_time,
-                                        args->argc,
-                                        args->argv,
-                                        args->properties,
-                                        args->auto_restart,
-                                        NULL);
-  delete args;
-  return process;
-}
-
-
 void* simcall_HANDLER_process_create(smx_simcall_t simcall,
                           const char *name,
                           xbt_main_func_t code,
index 099821d..fb96cb0 100644 (file)
@@ -91,7 +91,6 @@ XBT_PRIVATE smx_process_t SIMIX_process_create(
 XBT_PRIVATE void SIMIX_process_runall(void);
 XBT_PRIVATE void SIMIX_process_kill(smx_process_t process, smx_process_t issuer);
 XBT_PRIVATE void SIMIX_process_killall(smx_process_t issuer, int reset_pid);
-XBT_PRIVATE smx_process_t SIMIX_process_create_from_wrapper(smx_process_arg_t args);
 XBT_PRIVATE void SIMIX_process_stop(smx_process_t arg);
 XBT_PRIVATE void SIMIX_process_cleanup(smx_process_t arg);
 XBT_PRIVATE void SIMIX_process_empty_trash(void);
index da11235..bd51662 100644 (file)
@@ -604,8 +604,20 @@ void sg_platf_new_process(sg_platf_process_cbarg_t process)
     arg->properties = current_property_set;
 
     XBT_DEBUG("Process %s(%s) will be started at time %f", arg->name, arg->hostname, start_time);
-    SIMIX_timer_set(start_time, [](void* arg) {
-      SIMIX_process_create_from_wrapper((smx_process_arg_t) arg);
+    SIMIX_timer_set(start_time, [](void* p) {
+      smx_process_arg_t arg = static_cast<smx_process_arg_t>(p);
+      simix_global->create_process_function(
+                                            arg->name,
+                                            arg->code,
+                                            arg->data,
+                                            arg->hostname,
+                                            arg->kill_time,
+                                            arg->argc,
+                                            arg->argv,
+                                            arg->properties,
+                                            arg->auto_restart,
+                                            NULL);
+      delete arg;
     }, arg);
   } else {                      // start_time <= SIMIX_get_clock()
     XBT_DEBUG("Starting Process %s(%s) right now", arg->name, sg_host_get_name(host));