[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH v9 2/9] include: Add a lookup table of sizes
From: |
Alberto Garcia |
Subject: |
Re: [Qemu-devel] [PATCH v9 2/9] include: Add a lookup table of sizes |
Date: |
Fri, 21 Sep 2018 14:17:50 +0200 |
User-agent: |
Notmuch/0.18.2 (http://notmuchmail.org) Emacs/24.4.1 (i586-pc-linux-gnu) |
On Tue 18 Sep 2018 05:29:16 PM CEST, Leonid Bloch wrote:
> Adding a lookup table for the powers of two, with the appropriate size
> prefixes. This is needed when a size has to be stringified, in which
> case something like '(1 * KiB)' would become a literal '(1 * (1L <<
> 10))' string. Powers of two are used very often for sizes, so such a
> table will also make it easier and more intuitive to write them.
I wonder in what cases you want to stringify those literals... if it's
something that you want to show the user you either:
a) know the value in advance, and then you probably want to show
"4 GiB" instead of "4294967296 bytes"
b) don't know the value in advance (it's a variable), but then you
can't use these macros.
Am I missing anything?
Berto
- [Qemu-devel] [PATCH v9 0/9] Take the image size into account when allocating the L2 cache, Leonid Bloch, 2018/09/18
- [Qemu-devel] [PATCH v9 1/9] qcow2: Options' documentation fixes, Leonid Bloch, 2018/09/18
- [Qemu-devel] [PATCH v9 3/9] qcow2: Make sizes more humanly readable, Leonid Bloch, 2018/09/18
- [Qemu-devel] [PATCH v9 2/9] include: Add a lookup table of sizes, Leonid Bloch, 2018/09/18
- Re: [Qemu-devel] [PATCH v9 2/9] include: Add a lookup table of sizes,
Alberto Garcia <=
- [Qemu-devel] [PATCH v9 4/9] qcow2: Avoid duplication in setting the refcount cache size, Leonid Bloch, 2018/09/18
- [Qemu-devel] [PATCH v9 9/9] qcow2: Explicit number replaced by a constant, Leonid Bloch, 2018/09/18
- [Qemu-devel] [PATCH v9 8/9] qcow2: Set the default cache-clean-interval to 10 minutes, Leonid Bloch, 2018/09/18
- [Qemu-devel] [PATCH v9 6/9] qcow2: Increase the default upper limit on the L2 cache size, Leonid Bloch, 2018/09/18
- [Qemu-devel] [PATCH v9 7/9] qcow2: Resize the cache upon image resizing, Leonid Bloch, 2018/09/18