Преглед изворни кода

Fix uninitialized byte warning

Samuel Thibault пре 10 година
родитељ
комит
19f376080f
1 измењених фајлова са 3 додато и 0 уклоњено
  1. 3 0
      src/core/disk_ops/unistd/disk_unistd_global.c

+ 3 - 0
src/core/disk_ops/unistd/disk_unistd_global.c

@@ -330,6 +330,7 @@ get_unistd_global_bandwidth_between_disk_and_main_ram(unsigned node)
 	char * buf;
 	starpu_malloc_flags((void *) &buf, SIZE_DISK_MIN, 0);
 	STARPU_ASSERT(buf != NULL);
+	memset(buf, 0, SIZE_DISK_MIN);
 	
 	/* allocate memory */
 	void * mem = _starpu_disk_alloc(node, SIZE_DISK_MIN);
@@ -363,6 +364,8 @@ get_unistd_global_bandwidth_between_disk_and_main_ram(unsigned node)
 	starpu_malloc_flags((void *) &buf, MEM_SIZE, 0);
 	STARPU_ASSERT(buf != NULL);
 
+	memset(buf, 0, MEM_SIZE);
+
 	/* Measure latency */
 	start = starpu_timing_now();
 	for (iter = 0; iter < NITER; ++iter)