Browse Source

socl/src/command.c: use calloc to set allocated memory to 0

Nathalie Furmento 13 years ago
parent
commit
fcc7d24f2e
1 changed files with 2 additions and 2 deletions
  1. 2 2
      socl/src/command.c

+ 2 - 2
socl/src/command.c

@@ -96,7 +96,7 @@ command_ndrange_kernel command_ndrange_kernel_create (
 		const size_t *   global_work_size,
 		const size_t *   local_work_size)
 {
-	command_ndrange_kernel cmd = malloc(sizeof(struct command_ndrange_kernel_t));
+	command_ndrange_kernel cmd = calloc(1, sizeof(struct command_ndrange_kernel_t));
 	command_init(cmd, CL_COMMAND_NDRANGE_KERNEL);
 
 	dupEntity(kernel);
@@ -106,7 +106,7 @@ command_ndrange_kernel command_ndrange_kernel_create (
 	nullOrDup(local_work_size, work_dim*sizeof(size_t));
 
    	/* Codelet */
-   	cmd->codelet = (struct starpu_codelet*)malloc(sizeof(struct starpu_codelet));
+   	cmd->codelet = (struct starpu_codelet*)calloc(1, sizeof(struct starpu_codelet));
 	struct starpu_codelet * codelet = cmd->codelet;
 	codelet->where = STARPU_OPENCL;
 	codelet->power_model = NULL;