소스 검색

examples: free allocated memory

Nathalie Furmento 11 년 전
부모
커밋
bd9905de6c

+ 8 - 0
examples/sched_ctx/nested_sched_ctxs.c

@@ -109,6 +109,10 @@ int main(int argc, char **argv)
 
 	if (ncpus == 0)
 	{
+#ifdef STARPU_USE_CPU
+		free(procs1);
+		free(procs2);
+#endif
 		starpu_shutdown();
 		return 77;
 	}
@@ -199,6 +203,10 @@ int main(int argc, char **argv)
 	printf("ctx%d: tasks starpu executed %d out of %d\n", sched_ctx1, tasks_executed[0], NTASKS);
 	printf("ctx%d: tasks starpu executed %d out of %d\n", sched_ctx2, tasks_executed[1], NTASKS);
 
+#ifdef STARPU_USE_CPU
+	free(procs1);
+	free(procs2);
+#endif
 	starpu_shutdown();
 	return 0;
 }

+ 4 - 0
examples/sched_ctx/sched_ctx_without_sched_policy.c

@@ -156,6 +156,10 @@ int main(int argc, char **argv)
 	printf("ctx%d: tasks starpu executed %d out of %d\n", sched_ctx2, tasks_executed[1], NTASKS*NTASKS);
 
 enodev:
+#ifdef STARPU_USE_CPU
+	free(procs1);
+	free(procs2);
+#endif
 	starpu_shutdown();
 	return ncpus == 0 ? 77 : 0;
 }

+ 1 - 0
examples/worker_collections/worker_list_example.c

@@ -85,6 +85,7 @@ int main()
 
 	FPRINTF(stderr, "timing init = %lf \n", timing);
 	co->deinit(co);
+	free(co);
 	starpu_shutdown();
 
 	return 0;