Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Use homogeneous dictionaries whenever possible.
[simgrid.git] / src / gras / Virtu / rl_process.c
index 969f97a..cc364ce 100644 (file)
@@ -39,21 +39,20 @@ void gras_process_init()
   gras_procdata_init();
 
   /* initialize the host & process properties */
-  _host_properties = xbt_dict_new();
-  _process_properties = xbt_dict_new();
+  _host_properties = xbt_dict_new_homogeneous(xbt_free_f);
+  _process_properties = xbt_dict_new_homogeneous(xbt_free_f);
   env_iter = environ;
   while (*env_iter) {
     char *equal, *buf = xbt_strdup(*env_iter);
     equal = strchr(buf, '=');
     if (!equal) {
-      WARN1
+      XBT_WARN
           ("The environment contains an entry without '=' char: %s (ignore it)",
            *env_iter);
       continue;
     }
     *equal = '\0';
-    xbt_dict_set(_process_properties, buf, xbt_strdup(equal + 1),
-                 xbt_free_f);
+    xbt_dict_set(_process_properties, buf, xbt_strdup(equal + 1), NULL);
     free(buf);
     env_iter++;
   }
@@ -64,6 +63,7 @@ void gras_process_exit()
   gras_procdata_exit();
   free(_gras_procdata);
   xbt_dict_free(&_process_properties);
+  xbt_dict_free(&_host_properties);
 }
 
 const char *xbt_procname(void)
@@ -89,7 +89,7 @@ int gras_os_getpid(void)
 
 gras_procdata_t *gras_procdata_get(void)
 {
-  xbt_assert0(_gras_procdata, "Run gras_process_init (ie, gras_init)!");
+  xbt_assert(_gras_procdata, "Run gras_process_init (ie, gras_init)!");
 
   return _gras_procdata;
 }
@@ -102,7 +102,7 @@ typedef struct {
 
 static void *spawner_wrapper(void *data) {
   spawner_wrapper_args *a = data;
-  (*(a->code))(a->argc,a->argv);
+  a->code(a->argc, a->argv);
   free(a);
   return NULL;
 }
@@ -115,7 +115,7 @@ void gras_agent_spawn(const char *name,
   args->argc=argc;
   args->argv=argv;
   args->code=code;
-  xbt_os_thread_create(name,spawner_wrapper,args);
+  xbt_os_thread_create(name,spawner_wrapper,args, NULL);
 }
 
 /* **************************************************************************