stats_close() was not freeing memory for
single pass runs. It now takes in arg_passes
to determine when it should free memory.
Change-Id: I6623b7e30b76f9bf2e16008490f9b20484d03f31
}
-void stats_close(stats_io_t *stats)
+void stats_close(stats_io_t *stats, int last_pass)
{
if (stats->file)
{
- if (stats->pass == 1)
+ if (stats->pass == last_pass)
{
#if 0
#elif USE_POSIX_MMAP
}
else
{
- if (stats->pass == 1)
+ if (stats->pass == last_pass)
free(stats->buf.buf);
}
}
}
fclose(outfile);
- stats_close(&stats);
+ stats_close(&stats, arg_passes-1);
fprintf(stderr, "\n");
if (one_pass_only)