[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH 3/7] test-coroutine: avoid overflow on 32-bit sy
From: |
Ming Lei |
Subject: |
Re: [Qemu-devel] [PATCH 3/7] test-coroutine: avoid overflow on 32-bit systems |
Date: |
Mon, 1 Dec 2014 09:28:15 +0800 |
On Fri, Nov 28, 2014 at 10:12 PM, Paolo Bonzini <address@hidden> wrote:
> unsigned long is not large enough to represent 1000000000 * duration there.
> Just use floating point.
>
> Signed-off-by: Paolo Bonzini <address@hidden>
> ---
> tests/test-coroutine.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/tests/test-coroutine.c b/tests/test-coroutine.c
> index e22fae1..27d1b6f 100644
> --- a/tests/test-coroutine.c
> +++ b/tests/test-coroutine.c
> @@ -337,7 +337,7 @@ static void perf_cost(void)
> "%luns per coroutine",
> maxcycles,
> duration, ops,
> - (unsigned long)(1000000000 * duration) / maxcycles);
> + (unsigned long)(1000000000.0 * duration / maxcycles));
One more single bracket.
thanks,
Ming Lei
- [Qemu-devel] [PATCH 0/7] coroutine: optimizations, Paolo Bonzini, 2014/11/28
- [Qemu-devel] [PATCH 1/7] coroutine-ucontext: use __thread, Paolo Bonzini, 2014/11/28
- [Qemu-devel] [PATCH 2/7] qemu-thread: add per-thread atexit functions, Paolo Bonzini, 2014/11/28
- [Qemu-devel] [PATCH 3/7] test-coroutine: avoid overflow on 32-bit systems, Paolo Bonzini, 2014/11/28
- Re: [Qemu-devel] [PATCH 3/7] test-coroutine: avoid overflow on 32-bit systems,
Ming Lei <=
- [Qemu-devel] [PATCH 4/7] QSLIST: add lock-free operations, Paolo Bonzini, 2014/11/28
- [Qemu-devel] [PATCH 5/7] coroutine: rewrite pool to avoid mutex, Paolo Bonzini, 2014/11/28
[Qemu-devel] [PATCH 6/7] coroutine: drop qemu_coroutine_adjust_pool_size, Paolo Bonzini, 2014/11/28
[Qemu-devel] [PATCH 7/7] coroutine: try harder not to delete coroutines, Paolo Bonzini, 2014/11/28