summaryrefslogtreecommitdiffstats
path: root/test-file-zero-alloc-speed.c
diff options
context:
space:
mode:
authorAmit Shah <amit.shah@redhat.com>2009-04-20 18:19:31 +0530
committerAmit Shah <amit.shah@redhat.com>2009-04-20 18:19:31 +0530
commit7ea205fbf513452edc3f680120dab47a7e52f433 (patch)
treec882d7959bd32aad4ed88c3c55447cd54a413d96 /test-file-zero-alloc-speed.c
parent1bd92f4c1db9a406cbd49a470d7f5cc5c287e13f (diff)
downloadalloc-perf-7ea205fbf513452edc3f680120dab47a7e52f433.tar.gz
alloc-perf-7ea205fbf513452edc3f680120dab47a7e52f433.tar.xz
alloc-perf-7ea205fbf513452edc3f680120dab47a7e52f433.zip
Fix test for chunk-writing case
A few runs that resulted in bad timings for chunk-sized writes led Jan Kara and Mike Galbraith to discuss why it might be so and Mike spotted the error in the code -- we allocated a buffer of the size of the file instead of the size of the chunk -- in my case, 4G instead of 4K. Thanks Mike. Signed-off-by: Amit Shah <amit.shah@redhat.com>
Diffstat (limited to 'test-file-zero-alloc-speed.c')
-rw-r--r--test-file-zero-alloc-speed.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/test-file-zero-alloc-speed.c b/test-file-zero-alloc-speed.c
index 4954976..dcfc3b1 100644
--- a/test-file-zero-alloc-speed.c
+++ b/test-file-zero-alloc-speed.c
@@ -178,7 +178,7 @@ int do_write_chunks(char *target, int *fd, off_t len, size_t data)
unsigned long long remain = len;
char *zeros;
- zeros = calloc(1, len);
+ zeros = calloc(1, data);
printf("%llu-sized chunk run time:\n", data);
gettimeofday(&tv1, NULL);