瀏覽代碼

fix memleaks

Samuel Thibault 8 年之前
父節點
當前提交
f439df9417
共有 1 個文件被更改,包括 3 次插入0 次删除
  1. 3 0
      sc_hypervisor/src/sc_hypervisor.c

+ 3 - 0
sc_hypervisor/src/sc_hypervisor.c

@@ -540,6 +540,7 @@ double sc_hypervisor_get_nready_flops_of_all_sons_of_sched_ctx(unsigned sched_ct
 		ready_flops += sc_hypervisor_get_nready_flops_of_all_sons_of_sched_ctx(sched_ctxs[s]);
 		ready_flops += sc_hypervisor_get_nready_flops_of_all_sons_of_sched_ctx(sched_ctxs[s]);
 		//ready_flops += starpu_get_nready_flops_of_sched_ctx(sched_ctxs[s]);
 		//ready_flops += starpu_get_nready_flops_of_sched_ctx(sched_ctxs[s]);
 
 
+	free(sched_ctxs);
 	return ready_flops;
 	return ready_flops;
 }
 }
 static void _decrement_elapsed_flops_per_worker(unsigned sched_ctx, int worker, double flops)
 static void _decrement_elapsed_flops_per_worker(unsigned sched_ctx, int worker, double flops)
@@ -966,6 +967,7 @@ void _update_max_diff_hierarchically(unsigned father, double diff)
 #endif
 #endif
 			_update_max_diff_hierarchically(sched_ctxs_child[s], current_diff);
 			_update_max_diff_hierarchically(sched_ctxs_child[s], current_diff);
 		}
 		}
+		free(sched_ctxs_child);
 	}
 	}
 	return;
 	return;
 }
 }
@@ -1132,6 +1134,7 @@ void sc_hypervisor_update_resize_interval(unsigned *sched_ctxs, int nsched_ctxs,
 #endif
 #endif
 				_update_max_diff_hierarchically(max_nflops_sched_ctx, diff);
 				_update_max_diff_hierarchically(max_nflops_sched_ctx, diff);
 			}
 			}
+			free(sched_ctxs2);
 		}
 		}
 	}
 	}