History | View | Annotate | Download (12.5 kB)
hbitmap: Use non-bitops ctzl
Both uses of ctz have already eliminated zero, and thus the differencein edge conditions between the two routines is irrelevant.
Signed-off-by: Richard Henderson <rth@twiddle.net>Acked-by: Paolo Bonzini <pbonzini@redhat.com>...
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 differentsemantics and, for the one in bitops.h, a confusing name: the resultwas off-by-one compared to the library function ffsl....
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 <kwolf@redhat.com>...
add hierarchical bitmap data type and test cases
HBitmaps provides an array of bits. The bits are stored as usual in anarray of unsigned longs, but HBitmap is also optimized to provide fastiteration over set bits; going from one bit to the next is O(logB n)...