示例#1
0
        public PoolArena(int maxChunkCounter = 50)
        {
            this.tinyPoolPages   = new PoolPageList[TinyNum];
            this.smallPoolPages  = new PoolPageList[SmallNum];
            this.maxChunkCounter = maxChunkCounter;

            for (int i = 0; i < tinyPoolPages.Length; i++)
            {
                tinyPoolPages[i] = NewPoolPage((i + 1) * DefaultElemSize);
            }

            for (int i = 0; i < smallPoolPages.Length; i++)
            {
                smallPoolPages[i] = NewPoolPage(512 << (i + 1));
            }
            ck000 = new PoolChunkList(00, 25);
            ck025 = new PoolChunkList(25, 50);
            ck050 = new PoolChunkList(50, 75);
            ck075 = new PoolChunkList(75, 100);
            ck100 = new PoolChunkList(100, 101);

            PoolChunkList.Link(ck000, ck025);
            PoolChunkList.Link(ck025, ck050);
            PoolChunkList.Link(ck050, ck075);
            PoolChunkList.Link(ck075, ck100);
        }
示例#2
0
 public void SetNext(PoolChunkList item)
 {
     this.next = item;
 }
示例#3
0
 public static void Link(PoolChunkList p1, PoolChunkList p2)
 {
     p1.SetNext(p2);
     p2.SetPrev(p1);
 }
示例#4
0
 public void SetPrev(PoolChunkList item)
 {
     this.prev = item;
 }