On 12/12/2012 06:46 AM, Paolo Bonzini wrote: > 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) > worst case, with B = sizeof(long) * CHAR_BIT: the result is low enough > that the number of levels is in fact fixed. >
> > Reviewed-by: Laszlo Ersek <ler...@redhat.com> > Signed-off-by: Paolo Bonzini <pbonz...@redhat.com> > --- > hbitmap.c | 400 ++++++++++++++++++++++++++++++++++++++++++++++++++ > hbitmap.h | 207 ++++++++++++++++++++++++++ > tests/Makefile | 2 + > tests/test-hbitmap.c | 408 > +++++++++++++++++++++++++++++++++++++++++++++++++++ > trace-events | 5 + > 5 files changed, 1022 insertions(+) > create mode 100644 hbitmap.c > create mode 100644 hbitmap.h > create mode 100644 tests/test-hbitmap.c I've looked through this several times, but did another once-over, and you can feel free to add: Reviewed-by: Eric Blake <ebl...@redhat.com> -- Eric Blake eblake redhat com +1-919-301-3266 Libvirt virtualization library http://libvirt.org
signature.asc
Description: OpenPGP digital signature