Fix bitCount is 0 after intersect or union - #40
Conversation
use the fact that after i & (i - 1), the right most of set bit of "i" will be unset ref: https://www.quora.com/How-do-you-count-the-number-of-1-bits-in-a-number-using-only-bitwise-operations
|
@alexandrnikitin I cannot figure out why "java.lang.NoClassDefFoundError: sbt/inc/Analysis" happens, any advice? |
|
@alexandrnikitin Could you post the JVM crash log or reproduce step? |
|
I try to reproduce it and looks like something wrong with unsafe.getLong() in UnsafeBitArray.set() but still cannot find out the root cause(I guess the index is too big and cause the offset is beyond the allocated memory). Here's my reproduce log |
|
I add some debug log in UnsafeBitArray.scala then run looks like the memory is not big enough or the index is too big |
use the fact that after i & (i - 1), the right most of set bit of "i"
will be unset
ref: https://www.quora.com/How-do-you-count-the-number-of-1-bits-in-a-number-using-only-bitwise-operations