static final int checkMaxLgArrLongs ( final Memory dstMem ) { final int preBytes = CONST_PREAMBLE_LONGS << 3 ; final long cap = dstMem . getCapacity ( ) ; final int maxLgArrLongs = Integer . numberOfTrailingZeros ( floorPowerOf2 ( ( int ) ( cap - preBytes ) ) >>> 3 ) ; if ( maxLgArrLongs < MIN_LG_ARR_LONGS ) { throw new SketchesArgumentException ( "dstMem not large enough for minimum sized hash table: " + cap ) ; } return maxLgArrLongs ; }
Returns the correct maximum lgArrLongs given the capacity of the Memory . Checks that the capacity is large enough for the minimum sized hash table .