On 18.04.2015 01:49, John Snow wrote:
We add a bitmap merge operation to assist in error cases
where we wish to combine two bitmaps together.

This is algorithmically O(bits) provided HBITMAP_LEVELS remains
constant. For a full bitmap on a 64bit machine:
sum(bits/64^k, k, 0, HBITMAP_LEVELS) ~= 1.01587 * bits

We may be able to improve running speed for particularly sparse
bitmaps by using iterators, but the running time for dense maps
will be worse.

We present the simpler solution first, and we can refine it later
if needed.

Signed-off-by: John Snow <js...@redhat.com>
---
  include/qemu/hbitmap.h | 13 +++++++++++++
  util/hbitmap.c         | 33 +++++++++++++++++++++++++++++++++
  2 files changed, 46 insertions(+)

Reviewed-by: Max Reitz <mre...@redhat.com>

Reply via email to