Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Mem leak hunting!
[simgrid.git] / src / surf / surf.c
index 5308482..ce50a00 100644 (file)
@@ -103,6 +103,12 @@ void surf_action_change_state(surf_action_t action,
     xbt_swag_insert(action, action->state_set);
 }
 
+void surf_action_set_data(surf_action_t action,
+                         void *data)
+{
+  action->data=data;
+}
+
 void surf_init(int *argc, char **argv)
 {
   xbt_init(argc, argv);
@@ -135,6 +141,7 @@ void surf_finalize(void)
     xbt_dynar_free(&resource_list);
 
   tmgr_finalize();
+  surf_parse_lex_destroy();
 }
 
 double surf_solve(void)
@@ -180,7 +187,7 @@ double surf_solve(void)
   }
 
   if (min < 0.0)
-    return 0.0;
+    return -1.0;
 
   while ((next_event_date = tmgr_history_next_date(history)) != -1.0) {
     if (next_event_date > NOW + min)