private void Expand()
        {
            if (this._freePageList._head == -1)
            {
                int length;
                if (this._pages == null)
                {
                    length = 0;
                }
                else
                {
                    length = this._pages.Length;
                }
                int           num2      = length * 2;
                ExpiresPage[] pageArray = new ExpiresPage[Math.Min(Math.Max(length + 10, num2), length + 340)];
                for (int j = 0; j < length; j++)
                {
                    pageArray[j] = this._pages[j];
                }
                for (int k = length; k < pageArray.Length; k++)
                {
                    pageArray[k]._pagePrev = k - 1;
                    pageArray[k]._pageNext = k + 1;
                }
                pageArray[length]._pagePrev = -1;
                pageArray[pageArray.Length - 1]._pageNext = -1;
                this._freePageList._head = length;
                this._freePageList._tail = pageArray.Length - 1;
                this._pages = pageArray;
            }
            int pageIndex = this.RemoveFromListHead(ref this._freePageList);

            this.AddToListHead(pageIndex, ref this._freeEntryList);
            ExpiresEntry[] entryArray = new ExpiresEntry[0x80];
            entryArray[0]._cFree = 0x7f;
            for (int i = 0; i < (entryArray.Length - 1); i++)
            {
                entryArray[i]._next = new ExpiresEntryRef(pageIndex, i + 1);
            }
            entryArray[entryArray.Length - 1]._next = ExpiresEntryRef.INVALID;
            this._pages[pageIndex]._entries         = entryArray;
            this._cPagesInUse++;
            this.UpdateMinEntries();
        }
 private void Expand()
 {
     if (this._freePageList._head == -1)
     {
         int length;
         if (this._pages == null)
         {
             length = 0;
         }
         else
         {
             length = this._pages.Length;
         }
         int num2 = length * 2;
         ExpiresPage[] pageArray = new ExpiresPage[Math.Min(Math.Max(length + 10, num2), length + 340)];
         for (int j = 0; j < length; j++)
         {
             pageArray[j] = this._pages[j];
         }
         for (int k = length; k < pageArray.Length; k++)
         {
             pageArray[k]._pagePrev = k - 1;
             pageArray[k]._pageNext = k + 1;
         }
         pageArray[length]._pagePrev = -1;
         pageArray[pageArray.Length - 1]._pageNext = -1;
         this._freePageList._head = length;
         this._freePageList._tail = pageArray.Length - 1;
         this._pages = pageArray;
     }
     int pageIndex = this.RemoveFromListHead(ref this._freePageList);
     this.AddToListHead(pageIndex, ref this._freeEntryList);
     ExpiresEntry[] entryArray = new ExpiresEntry[0x80];
     entryArray[0]._cFree = 0x7f;
     for (int i = 0; i < (entryArray.Length - 1); i++)
     {
         entryArray[i]._next = new ExpiresEntryRef(pageIndex, i + 1);
     }
     entryArray[entryArray.Length - 1]._next = ExpiresEntryRef.INVALID;
     this._pages[pageIndex]._entries = entryArray;
     this._cPagesInUse++;
     this.UpdateMinEntries();
 }