From 5fd5bff93ecb155f478530a01c2f265e6e05bd4b Mon Sep 17 00:00:00 2001 From: Arnaud Giersch Date: Fri, 14 Jun 2013 11:25:47 +0200 Subject: [PATCH] Add a small value to avoid rounding differences between x86 and x86_64. --- src/surf/storage.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/surf/storage.c b/src/surf/storage.c index dc8b217e96..df2d0d44cd 100644 --- a/src/surf/storage.c +++ b/src/surf/storage.c @@ -261,8 +261,11 @@ static void storage_update_actions_state(double now, double delta) if(action->type == WRITE) { double rate = lmm_variable_getvalue(GENERIC_LMM_ACTION(action).variable); - ((storage_t)(action->storage))->used_size += delta * rate; // disk usage - ((surf_action_t)action)->file->size += delta * rate; // file size + /* Hack to avoid rounding differences between x86 and x86_64 + * (note that the next sizes are of type size_t). */ + long incr = delta * rate + MAXMIN_PRECISION; + ((storage_t)(action->storage))->used_size += incr; // disk usage + ((surf_action_t)action)->file->size += incr; // file size } } -- 2.20.1