Esempio n. 1
0
File: Caches.cs Progetto: mo5h/omeo
 public ObjectCache(int cacheSize)
 {
     if (cacheSize < minSize)
     {
         cacheSize = minSize;
     }
     else if (cacheSize > maxSize)
     {
         cacheSize = maxSize;
     }
     _top           = _back = 0;
     _cache         = new CacheEntry[cacheSize + 1];
     _hashTableSize = HashtableParams.AdjustHashtableSize((uint)cacheSize);
     _hashTable     = new ushort[_hashTableSize];
     _Attempts      = 0;
     _Hits          = 0;
     _count         = _firstFree = 0;
     _eventArgs     = new ObjectCacheEventArgs();
 }
Esempio n. 2
0
 private void _cache_ObjectRemoved(object sender, ObjectCacheEventArgs e)
 {
     _freeNode = (BTreePage)e.Object;
     _freeNode.Write();
 }