CountOnes() public method

public CountOnes ( ) : long
return long
示例#1
0
 internal int GetFreeBlockNumber()
 {
     // get the first free block or append to the end
     if (_freeList.CountOnes() > 0)
     {
         int i = _freeList.GetFirst();
         _freeList.Set(i, false);
         return(i);
     }
     else
     {
         return(Interlocked.Increment(ref _lastBlockNumber));//++;
     }
 }