javaewah
javaewah copied to clipboard
Address fragmentation issue caused by andNot method
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);