Browse Source

fix memory leak

Samuel Thibault 9 years ago
parent
commit
6920c2293e

+ 2 - 1
doc/doxygen/chapters/api/insert_task.doxy

@@ -56,7 +56,8 @@ constant
 this macro is used when calling starpu_task_insert(), and must
 this macro is used when calling starpu_task_insert(), and must
 be followed by a memory buffer containing the arguments to be given to
 be followed by a memory buffer containing the arguments to be given to
 the task, and by the size of the arguments. The memory buffer should
 the task, and by the size of the arguments. The memory buffer should
-be the result of a previous call to starpu_codelet_pack_args()
+be the result of a previous call to starpu_codelet_pack_args(), and will be
+freed (i.e. starpu_task::cl_arg_free will be set to 1)
 
 
 \def STARPU_CALLBACK
 \def STARPU_CALLBACK
 \ingroup API_Insert_Task
 \ingroup API_Insert_Task

+ 1 - 0
src/util/starpu_task_insert_utils.c

@@ -324,6 +324,7 @@ int _starpu_task_insert_create(struct starpu_codelet *cl, struct starpu_task **t
 		{
 		{
 			(*task)->cl_arg = va_arg(varg_list, void *);
 			(*task)->cl_arg = va_arg(varg_list, void *);
 			(*task)->cl_arg_size = va_arg(varg_list, size_t);
 			(*task)->cl_arg_size = va_arg(varg_list, size_t);
+			(*task)->cl_arg_free = 1;
 		}
 		}
 		else if (arg_type==STARPU_CALLBACK)
 		else if (arg_type==STARPU_CALLBACK)
 		{
 		{