示例#1
0
 internal BlockObjQueue.Block NewBlock()
 {
     BlockObjQueue.Block b = next;
     if (b == null)
     {
         return(new BlockObjQueue.Block());
     }
     next = b.next;
     b.Clear();
     return(b);
 }
示例#2
0
        internal virtual RevObject Next()
        {
            BlockObjQueue.Block b = head;
            if (b == null)
            {
                return(null);
            }
            RevObject c = b.Pop();

            if (b.IsEmpty())
            {
                head = b.next;
                if (head == null)
                {
                    tail = null;
                }
                free.FreeBlock(b);
            }
            return(c);
        }
示例#3
0
		internal virtual void Add(RevObject c)
		{
			BlockObjQueue.Block b = tail;
			if (b == null)
			{
				b = free.NewBlock();
				b.Add(c);
				head = b;
				tail = b;
				return;
			}
			else
			{
				if (b.IsFull())
				{
					b = free.NewBlock();
					tail.next = b;
					tail = b;
				}
			}
			b.Add(c);
		}
示例#4
0
 internal virtual void Add(RevObject c)
 {
     BlockObjQueue.Block b = tail;
     if (b == null)
     {
         b = free.NewBlock();
         b.Add(c);
         head = b;
         tail = b;
         return;
     }
     else
     {
         if (b.IsFull())
         {
             b         = free.NewBlock();
             tail.next = b;
             tail      = b;
         }
     }
     b.Add(c);
 }
示例#5
0
		internal virtual RevObject Next()
		{
			BlockObjQueue.Block b = head;
			if (b == null)
			{
				return null;
			}
			RevObject c = b.Pop();
			if (b.IsEmpty())
			{
				head = b.next;
				if (head == null)
				{
					tail = null;
				}
				free.FreeBlock(b);
			}
			return c;
		}
示例#6
0
			internal void Clear()
			{
				next = null;
				headIndex = 0;
				tailIndex = 0;
			}
示例#7
0
			internal void FreeBlock(BlockObjQueue.Block b)
			{
				b.next = next;
				next = b;
			}
示例#8
0
			internal BlockObjQueue.Block NewBlock()
			{
				BlockObjQueue.Block b = next;
				if (b == null)
				{
					return new BlockObjQueue.Block();
				}
				next = b.next;
				b.Clear();
				return b;
			}
示例#9
0
 internal void Clear()
 {
     next      = null;
     headIndex = 0;
     tailIndex = 0;
 }
示例#10
0
 internal void FreeBlock(BlockObjQueue.Block b)
 {
     b.next = next;
     next   = b;
 }