@SuppressWarnings("unchecked") public CacheLongKeyLIRS(Config config){
  setMaxMemory(config.maxMemory);
  this.nonResidentQueueSize=config.nonResidentQueueSize;
  DataUtils.checkArgument(Integer.bitCount(config.segmentCount) == 1,"The segment count must be a power of 2, is {0}",config.segmentCount);
  this.segmentCount=config.segmentCount;
  this.segmentMask=segmentCount - 1;
  this.stackMoveDistance=config.stackMoveDistance;
  segments=new Segment[segmentCount];
  clear();
  this.segmentShift=32 - Integer.bitCount(segmentMask);
}

@ SuppressWarnings ( "unchecked" ) public CacheLongKeyLIRS ( Config config ) { setMaxMemory ( config . maxMemory ) ; this . nonResidentQueueSize = config . nonResidentQueueSize ; DataUtils . checkArgument ( Integer . bitCount ( config . segmentCount ) == 1 , "The segment count must be a power of 2, is {0}" , config . segmentCount ) ; this . segmentCount = config . segmentCount ; this . segmentMask = segmentCount - 1 ; this . stackMoveDistance = config . stackMoveDistance ; segments = new Segment [ segmentCount ] ; clear ( ) ; this . segmentShift = 32 - Integer . bitCount ( segmentMask ) ; }
create a new cache with the given memory size .
