+void __MSG_process_cleanup(smx_process_t smx_proc)
+{
+ /* This function should be always be executed by the process being
+ * cleaned up */
+ if(smx_proc != SIMIX_process_self())
+ THROW_IMPOSSIBLE;
+
+ /* arg is no longer used, just kept to avoid changing the interface */
+ m_process_t proc = SIMIX_process_self_get_data();
+
+#ifdef HAVE_TRACING
+ TRACE_msg_process_end(proc);
+#endif
+
+ if (msg_global)
+ xbt_swag_remove(proc, msg_global->process_list);
+
+ SIMIX_process_cleanup(smx_proc);
+ if (proc->name) {
+ free(proc->name);
+ proc->name = NULL;
+ }
+ if (proc->simdata) {
+ free(proc->simdata);
+ proc->simdata = NULL;
+ }
+ free(proc);
+
+ return;
+}
+
+/* This function creates a MSG process. It has the prototype enforced by SIMIX_function_register_process_create */
+void _MSG_process_create_from_SIMIX(void* process, const char *name,
+ xbt_main_func_t code, void *data,
+ char *hostname, int argc, char **argv,
+ xbt_dict_t properties)
+{
+ m_host_t host = MSG_get_host_by_name(hostname);
+ m_process_t p = MSG_process_create_with_environment(name, code, data,
+ host, argc, argv,
+ properties);
+ *((m_process_t*) process) = p;
+}
+
+/** \ingroup m_process_management
+ * \brief Creates and runs a new #m_process_t.
+ *
+ * Does exactly the same as #MSG_process_create_with_arguments but without
+ providing standard arguments (\a argc, \a argv, \a start_time, \a kill_time).
+ * \sa MSG_process_create_with_arguments
+ */
+m_process_t MSG_process_create(const char *name,
+ xbt_main_func_t code, void *data,
+ m_host_t host)
+{
+ return MSG_process_create_with_environment(name, code, data, host, -1,
+ NULL, NULL);
+}
+