Beispiel #1
0
        private void RemoveFromList(int pageIndex, ref ExpiresPageList list)
        {
            Debug.Assert((list._head == -1) == (list._tail == -1), "(list._head == -1) == (list._tail == -1)");

            if ((_pages[(pageIndex)]._pagePrev) != -1)
            {
                Debug.Assert((_pages[((_pages[(pageIndex)]._pagePrev))]._pageNext) == pageIndex, "PageNext(PagePrev(pageIndex)) == pageIndex");
                (_pages[((_pages[(pageIndex)]._pagePrev))]._pageNext) = (_pages[(pageIndex)]._pageNext);
            }
            else
            {
                Debug.Assert(list._head == pageIndex, "list._head == pageIndex");
                list._head = (_pages[(pageIndex)]._pageNext);
            }

            if ((_pages[(pageIndex)]._pageNext) != -1)
            {
                Debug.Assert((_pages[((_pages[(pageIndex)]._pageNext))]._pagePrev) == pageIndex, "PagePrev(PageNext(pageIndex)) == pageIndex");
                (_pages[((_pages[(pageIndex)]._pageNext))]._pagePrev) = (_pages[(pageIndex)]._pagePrev);
            }
            else
            {
                Debug.Assert(list._tail == pageIndex, "list._tail == pageIndex");
                list._tail = (_pages[(pageIndex)]._pagePrev);
            }

            (_pages[(pageIndex)]._pagePrev) = -1;
            (_pages[(pageIndex)]._pageNext) = -1;
        }
        private int RemoveFromListHead(ref ExpiresPageList list)
        {
            int pageIndex = list._head;

            this.RemoveFromList(pageIndex, ref list);
            return(pageIndex);
        }
 private void MoveToListTail(int pageIndex, ref ExpiresPageList list)
 {
     if (list._tail != pageIndex)
     {
         this.RemoveFromList(pageIndex, ref list);
         this.AddToListTail(pageIndex, ref list);
     }
 }
 private void MoveToListHead(int pageIndex, ref ExpiresPageList list)
 {
     if (list._head != pageIndex)
     {
         this.RemoveFromList(pageIndex, ref list);
         this.AddToListHead(pageIndex, ref list);
     }
 }
Beispiel #5
0
        private int RemoveFromListHead(ref ExpiresPageList list)
        {
            Debug.Assert(list._head != -1, "list._head != -1");

            int oldHead = list._head;

            RemoveFromList(oldHead, ref list);
            return(oldHead);
        }
Beispiel #6
0
        private void MoveToListTail(int pageIndex, ref ExpiresPageList list)
        {
            Debug.Assert(list._head != -1, "list._head != -1");
            Debug.Assert(list._tail != -1, "list._tail != -1");

            if (list._tail == pageIndex)
            {
                return;
            }

            RemoveFromList(pageIndex, ref list);
            AddToListTail(pageIndex, ref list);
        }
 private void AddToListTail(int pageIndex, ref ExpiresPageList list)
 {
     this._pages[pageIndex]._pageNext = -1;
     this._pages[pageIndex]._pagePrev = list._tail;
     if (list._tail != -1)
     {
         this._pages[list._tail]._pageNext = pageIndex;
     }
     else
     {
         list._head = pageIndex;
     }
     list._tail = pageIndex;
 }
Beispiel #8
0
        private void AddToListTail(int pageIndex, ref ExpiresPageList list)
        {
            Debug.Assert((list._head == -1) == (list._tail == -1), "(list._head == -1) == (list._tail == -1)");

            (_pages[(pageIndex)]._pageNext) = -1;
            (_pages[(pageIndex)]._pagePrev) = list._tail;
            if (list._tail != -1)
            {
                Debug.Assert((_pages[(list._tail)]._pageNext) == -1, "PageNext(list._tail) == -1");
                (_pages[(list._tail)]._pageNext) = pageIndex;
            }
            else
            {
                list._head = pageIndex;
            }

            list._tail = pageIndex;
        }
 private void RemoveFromList(int pageIndex, ref ExpiresPageList list)
 {
     if (this._pages[pageIndex]._pagePrev != -1)
     {
         this._pages[this._pages[pageIndex]._pagePrev]._pageNext = this._pages[pageIndex]._pageNext;
     }
     else
     {
         list._head = this._pages[pageIndex]._pageNext;
     }
     if (this._pages[pageIndex]._pageNext != -1)
     {
         this._pages[this._pages[pageIndex]._pageNext]._pagePrev = this._pages[pageIndex]._pagePrev;
     }
     else
     {
         list._tail = this._pages[pageIndex]._pagePrev;
     }
     this._pages[pageIndex]._pagePrev = -1;
     this._pages[pageIndex]._pageNext = -1;
 }