[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH v2 11/15] bitmap: add a generic bitmap and bitop
From: |
Corentin Chary |
Subject: |
Re: [Qemu-devel] [PATCH v2 11/15] bitmap: add a generic bitmap and bitops library |
Date: |
Thu, 11 Nov 2010 22:25:35 +0100 |
On Thu, Nov 11, 2010 at 8:07 PM, Blue Swirl <address@hidden> wrote:
> Please don't use identifiers starting with underscore.
Ok, I think __bitmap_* could become slow__bitmap_* (because they are
the slow path)
> We already have ffs() in qemu-common.h and oslib-win32.c. Please use
> the same method.
>
This is not a standard ffs, this is the ffs used in the kernel, where
I stealed all those bitop functions.
std ffs: return the position of the first bit set, or 0 if no bits are set in i.
kernel ffs: Undefined if no bit exists, so code should check against 0 first.
__ffs(0): 31
ffs(0): 0
__ffs(1): 0
ffs(1): 1
This behavior is needed for all the other function to work (and makes
more sense that the normal ffs).
But .. maybe I should just use ffs() - 1
--
Corentin Chary
http://xf.iksaif.net
- [Qemu-devel] [PATCH v2 05/15] vnc: palette: use a pool to reduce memory allocations, (continued)
- [Qemu-devel] [PATCH v2 05/15] vnc: palette: use a pool to reduce memory allocations, Corentin Chary, 2010/11/11
- [Qemu-devel] [PATCH v2 06/15] vnc: palette: add palette_init calls, Corentin Chary, 2010/11/11
- [Qemu-devel] [PATCH v2 07/15] vnc: palette: and fill and color calls., Corentin Chary, 2010/11/11
- [Qemu-devel] [PATCH v2 02/15] vnc: add a way to get the update frequency for a given region, Corentin Chary, 2010/11/11
- [Qemu-devel] [PATCH v2 10/15] vnc: fix lossy rect refreshing, Corentin Chary, 2010/11/11
- [Qemu-devel] [PATCH v2 08/15] vnc: Add ZRLE and ZYWRLE encodings., Corentin Chary, 2010/11/11
- [Qemu-devel] [PATCH v2 12/15] vnc: use the new generic bitmap functions, Corentin Chary, 2010/11/11
- [Qemu-devel] [PATCH v2 11/15] bitmap: add a generic bitmap and bitops library, Corentin Chary, 2010/11/11
- [Qemu-devel] [PATCH v2 09/15] vnc: fix uint8_t comparisons with negative values, Corentin Chary, 2010/11/11
- [Qemu-devel] [PATCH v2 13/15] vnc: don't try to send bigger updates that client height, Corentin Chary, 2010/11/11
- [Qemu-devel] [PATCH v2 14/15] vnc: tight: tweak adaptive tight settings, Corentin Chary, 2010/11/11
- [Qemu-devel] [PATCH v2 15/15] vnc: add a non-adaptive option, Corentin Chary, 2010/11/11
- [Qemu-devel] Re: [PATCH v2 00/15] vnc: adapative tight, zrle, zywrle, and bitmap module, Alexander Graf, 2010/11/11