steadystate: Use calloc(3)
[fio.git] / steadystate.c
index 951376f86796bebea605d80a3c8b279caa4040d2..43c715c96422dddfcbca6f8fed9871c80ee4ffd2 100644 (file)
@@ -8,13 +8,8 @@ bool steadystate_enabled = false;
 
 static void steadystate_alloc(struct thread_data *td)
 {
 
 static void steadystate_alloc(struct thread_data *td)
 {
-       int i;
-
-       td->ss.bw_data = malloc(td->ss.dur * sizeof(uint64_t));
-       td->ss.iops_data = malloc(td->ss.dur * sizeof(uint64_t));
-       /* initialize so that it is obvious if the cache is not full in the output */
-       for (i = 0; i < td->ss.dur; i++)
-               td->ss.iops_data[i] = td->ss.bw_data[i] = 0;
+       td->ss.bw_data = calloc(td->ss.dur, sizeof(uint64_t));
+       td->ss.iops_data = calloc(td->ss.dur, sizeof(uint64_t));
 
        td->ss.state |= __FIO_SS_DATA;
 }
 
        td->ss.state |= __FIO_SS_DATA;
 }