Beispiel #1
0
        private PoolPage CreateSubpagePoolHead()
        {
            var head = new PoolPage(_pageSize);

            head.Prev = head;
            head.Next = head;
            return(head);
        }
Beispiel #2
0
        private long AllocatePage(int normCapacity)
        {
            var id = this.AllocateNode(_maxOrder);

            if (id < 0)
            {
                return(id);
            }
            _freeBytes -= _pageSize;

            int subpageIdx = this.PageIdx(id);
            var subpage    = _subpages[subpageIdx];

            if (subpage == null)
            {
                subpage = new PoolPage(this, id, this.RunOffset(id), _pageSize, normCapacity);
                _subpages[subpageIdx] = subpage;
            }
            return(subpage.Allocate());
        }
Beispiel #3
0
 private PoolPage CreateSubpagePoolHead()
 {
     var head = new PoolPage(_pageSize);
     head.Prev = head;
     head.Next = head;
     return head;
 }
Beispiel #4
0
        private long AllocatePage(int normCapacity)
        {
            var id = this.AllocateNode(_maxOrder);
            if (id < 0)
            {
                return id;
            }
            _freeBytes -= _pageSize;

            int subpageIdx = this.PageIdx(id);
            var subpage = _subpages[subpageIdx];
            if (subpage == null)
            {
                subpage= new PoolPage(this, id, this.RunOffset(id), _pageSize, normCapacity);
                _subpages[subpageIdx] = subpage;
            }
            return subpage.Allocate();
        }