Beispiel #1
0
        protected void baseDestroy()
        {
            // search for the name
            MLink pNode;
            MLink pTmpNode;

            // Active List
            pNode = this.pActive;
            while (pNode != null)
            {
                // walking through the list
                pTmpNode = pNode;
                pNode    = pNode.pMNext;

                // node to cleanup
                Debug.Assert(pTmpNode != null);
                this.derivedDestroyNode(pTmpNode);
                MLink.RemoveNode(ref this.pActive, pTmpNode);
                pTmpNode = null;

                this.mNumActive--;
                this.mTotalNodeCount--;
            }

            // Reserve List
            pNode = this.pReserve;
            while (pNode != null)
            {
                // walking through the list
                pTmpNode = pNode;
                pNode    = pNode.pMNext;

                // node to cleanup
                Debug.Assert(pTmpNode != null);
                this.derivedDestroyNode(pTmpNode);
                MLink.RemoveNode(ref this.pReserve, pTmpNode);
                pTmpNode = null;

                this.mNumReserve--;
                this.mTotalNodeCount--;
            }
        }
Beispiel #2
0
        protected void baseRemoveNode(MLink targetNode)
        {
            //make sure node exists
            Debug.Assert(targetNode != null);

            // Don't do the work here...
            // abstract/delegate it to DLink
            MLink.RemoveNode(ref this.pActive, targetNode);

            // wash node before returning to reserve list
            this.derivedWashNode(targetNode);

            // add pulled node to the reserve list
            MLink.AddToFront(ref this.pReserve, targetNode);

            // stats update
            this.mNumActive--;
            this.mNumReserve++;

            //Debug.WriteLine("Base Remove called");
        }