javaewah icon indicating copy to clipboard operation
javaewah copied to clipboard

Address fragmentation issue caused by andNot method

Open lemire opened this issue 4 years ago • 0 comments

In some cases, the andNot function can cause fragmentation: the insertion of zero literal words inside the bitmap. One can produce it with the following code:

        EWAHCompressedBitmap one = new EWAHCompressedBitmap();
        EWAHCompressedBitmap other = new EWAHCompressedBitmap();
        one.set(16627);
        other.set(52811);
        other = other.and(one);
        one = one.andNot(other);
        one.set(16039);
        other.set(78669);
        other = other.or(one);
        one = one.and(other);
        other = other.andNot(one);

lemire avatar May 18 '21 20:05 lemire