Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Remove a huge memory leak
[simgrid.git] / src / simdag / sd_task.c
index dc05a22..cf72e8b 100644 (file)
@@ -14,6 +14,7 @@ static void __SD_task_destroy_scheduling_data(SD_task_t task);
  *
  * \param name the name of the task (can be \c NULL)
  * \param data the user data you want to associate with the task (can be \c NULL)
+ * \param amount amount of the task
  * \return the new task
  * \see SD_task_destroy()
  */
@@ -421,8 +422,8 @@ double SD_task_get_execution_time(SD_task_t task,
     time = SD_workstation_get_computation_time(workstation_list[i], computation_amount[i]);
     
     for (j = 0; j < workstation_nb; j++) {
-      time += SD_workstation_route_get_communication_time(workstation_list[i], workstation_list[j],
-                                                         communication_amount[i * workstation_nb + j]);
+      time += SD_route_get_communication_time(workstation_list[i], workstation_list[j],
+                                             communication_amount[i * workstation_nb + j]);
     }
 
     if (time > max_time) {
@@ -536,6 +537,8 @@ surf_action_t __SD_task_run(SD_task_t task) {
                          task->amount,
                          task->rate);
 
+  DEBUG1("surf_action = %p", surf_action);
+
   __SD_task_destroy_scheduling_data(task); /* now the scheduling data are not useful anymore */
   __SD_task_set_state(task, SD_RUNNING);
 
@@ -581,6 +584,9 @@ void SD_task_destroy(SD_task_t task) {
   if (task->name != NULL)
     xbt_free(task->name);
 
+  if (task->surf_action != NULL)
+    xbt_free(task->surf_action);
+
   xbt_dynar_free(&task->tasks_before);
   xbt_dynar_free(&task->tasks_after);
   xbt_free(task);