Statistics
| Branch: | Revision:

root / include / qemu / hbitmap.h @ 10f5bff6

History | View | Annotate | Download (5.6 kB)

# Date Author Comment
18331e7c 02/16/2013 01:11 pm Richard Henderson

hbitmap: Use non-bitops ctzl

Both uses of ctz have already eliminated zero, and thus the difference
in edge conditions between the two routines is irrelevant.

Signed-off-by: Richard Henderson <>
Acked-by: Paolo Bonzini <>...

fbeadf50 02/02/2013 10:16 pm Paolo Bonzini

bitops: unify bitops_ffsl with the one in host-utils.h, call it bitops_ctzl

We had two copies of a ffs function for longs with subtly different
semantics and, for the one in bitops.h, a confusing name: the result
was off-by-one compared to the library function ffsl....

1b095244 01/25/2013 07:18 pm Paolo Bonzini

hbitmap: add assertion on hbitmap_iter_init

hbitmap_iter_init causes an out-of-bounds access when the "first"
argument is or greater than or equal to the size of the bitmap.
Forbid this with an assertion, and remove the failing testcase.

Reported-by: Kevin Wolf <>...

e7c033c3 01/25/2013 07:18 pm Paolo Bonzini

add hierarchical bitmap data type and test cases

HBitmaps provides an array of bits. The bits are stored as usual in an
array of unsigned longs, but HBitmap is also optimized to provide fast
iteration over set bits; going from one bit to the next is O(logB n)...