+ * Garbage collection
+ *
+ * Should be called some time to time to free the memory allocated for processes
+ * that have finished (or killed).
+ */
+void SIMIX_process_empty_trash(void)
+{
+ smx_process_t process = NULL;
+ int i;
+
+ while ((process = xbt_swag_extract(simix_global->process_to_destroy))){
+ free(process->name);
+ process->name = NULL;
+
+ if (process->argv) {
+ for (i = 0; i < process->argc; i++)
+ if (process->argv[i])
+ free(process->argv[i]);
+
+ free(process->argv);
+ }
+
+ free(process);
+ }
+}
+
+/**
+ * \brief Creates and runs the maestro process
+ *
+ */
+
+void __SIMIX_create_maestro_process()
+{
+ smx_process_t process = NULL;
+ process = xbt_new0(s_smx_process_t, 1);
+
+ /* Process data */
+ process->name = (char *)"";
+
+ /*Create the right context type (FIXME: check the return value for success)*/
+ SIMIX_context_create_maestro(&process);
+
+ /* Set it as the maestro process */
+ simix_global->maestro_process = process;
+ simix_global->current_process = process;
+
+ return;
+}
+
+/**