Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
some optimizations
authorTakishipp <toufik.boubehziz@gmail.com>
Mon, 17 Jul 2017 10:05:59 +0000 (12:05 +0200)
committerTakishipp <toufik.boubehziz@gmail.com>
Mon, 17 Jul 2017 10:05:59 +0000 (12:05 +0200)
src/instr/instr_config.cpp
src/instr/instr_paje_types.cpp
src/instr/instr_private.h

index e6eb6f5..82b951f 100644 (file)
@@ -63,6 +63,8 @@ static int trace_precision;
 static bool trace_configured = false;
 static bool trace_active     = false;
 
+static type_t rootType = nullptr;        /* the root type */
+
 instr_fmt_type_t instr_fmt_type = instr_fmt_paje;
 
 static void TRACE_getopts()
@@ -148,9 +150,9 @@ int TRACE_end()
 
     /* destroy all data structures of tracing (and free) */
     PJ_container_free_all();
-    PJ_type_free_all();
+    recursiveDestroyType (PJ_type_get_root());
     PJ_container_release();
-    PJ_type_release();
+    rootType = nullptr;
 
     xbt_dict_free(&user_link_variables);
     xbt_dict_free(&user_host_variables);
index c5dc7fe..333e806 100644 (file)
@@ -66,7 +66,7 @@ void PJ_type_free (type_t type)
   type = nullptr;
 }
 
-static void recursiveDestroyType (type_t type)
+void recursiveDestroyType (type_t type)
 {
   XBT_DEBUG("recursiveDestroyType %s", type->name);
   xbt_dict_cursor_t cursor = nullptr;
@@ -78,12 +78,6 @@ static void recursiveDestroyType (type_t type)
   PJ_type_free(type);
 }
 
-void PJ_type_free_all ()
-{
-  recursiveDestroyType (PJ_type_get_root());
-  rootType = nullptr;
-}
-
 type_t PJ_type_get (const char *name, type_t father)
 {
   type_t ret = PJ_type_get_or_null (name, father);
index 30855a3..d3d45c2 100644 (file)
@@ -346,8 +346,10 @@ XBT_PRIVATE XBT_PRIVATE type_t PJ_type_variable_new (const char *name, const cha
 XBT_PRIVATE type_t PJ_type_state_new (const char *name, type_t father);
 XBT_PUBLIC(type_t)  PJ_type_get (const char *name, const type_t father);
 XBT_PUBLIC(type_t)  PJ_type_get_or_null (const char *name, type_t father);
-void PJ_type_free_all ();
-XBT_PRIVATE XBT_PRIVATE void PJ_type_free (type_t type);
+XBT_PRIVATE XBT_PRIVATE void PJ_type_free (type_t type); 
+
+/* instr_config.c */
+XBT_PRIVATE void recursiveDestroyType (type_t type);
 
 /* instr_paje_values.c */
 XBT_PUBLIC(val_t)  PJ_value_new (const char *name, const char *color, type_t father);