to avoid memory leaks.
* Add an interface to auto-restart processes when the host in which they are
executing comes back.
+ * Ensures that SIMIX_clean is called automatically. It's not part of
+ the public interface anymore (bindings should be updated).
SimDag:
* New types of typed tasks. SD_TASK_COMP_PAR_AMDAHL represents a
/********************************** Global ************************************/
/* Initialization and exit */
XBT_PUBLIC(void) SIMIX_global_init(int *argc, char **argv);
-XBT_PUBLIC(void) SIMIX_clean(void);
XBT_PUBLIC(void) SIMIX_function_register_process_cleanup(void_pfn_smxprocess_t function);
return;
}
-void gras_clean()
-{
- SIMIX_clean();
+void gras_clean(){ /* this function is not needed anymore and could be removed, but I feel so lazy */
}
TRACE_end();
#endif
- SIMIX_clean();
-
xbt_swag_free(msg_global->vms);
free(msg_global);
msg_global = NULL;
static void SIMIX_action_mallocator_free_f(void* action);
static void SIMIX_action_mallocator_reset_f(void* action);
+static void SIMIX_clean(void);
+
/* FIXME: Yeah, I'll do it in a portable maner one day [Mt] */
#include <signal.h>
XBT_DEBUG("ADD SIMIX LEVELS");
SIMIX_HOST_LEVEL = xbt_lib_add_level(host_lib,SIMIX_host_destroy);
+
+ atexit(SIMIX_clean);
}
/**
*
* This functions remove the memory used by SIMIX
*/
-void SIMIX_clean(void)
+static void SIMIX_clean(void)
{
#ifdef TIME_BENCH_PER_SR
smx_ctx_raw_new_sr();
TRACE_end();
#endif
- SIMIX_clean();
return 0;
}