Beispiel #1
0
        public long CountOnes()
        {
            if (_state == TYPE.Indexes)
            {
                return(_offsets.Count());
            }

            long c = 0;

            CheckBitArray();

            foreach (uint i in _uncompressed)
            {
                c += BitCount(i);
            }

            return(c);
        }
Beispiel #2
0
 public void FreeMemory()
 {
     _index.FreeMemory();
     try
     {
         List <int> free = new List <int>();
         foreach (var k in _cache.Keys())
         {
             var val = _cache.GetValue(k);
             if (val.isDirty == false)
             {
                 free.Add(k);
             }
         }
         _log.Info("releasing page count = " + free.Count + " out of " + _cache.Count());
         foreach (var i in free)
         {
             _cache.Remove(i);
         }
     }
     catch { }
 }
 internal void FreeMemory()
 {
     try
     {
         List <int> free = new List <int>();
         foreach (var k in _cache.Keys())
         {
             var val = _cache.GetValue(k);
             if (val.isDirty == false)
             {
                 free.Add(k);
             }
         }
         log.Info("releasing bmp count = " + free.Count + " out of " + _cache.Count());
         foreach (int i in free)
         {
             _cache.Remove(i);
         }
     }
     catch (Exception ex) {
         log.Error(ex);
     }
 }