Ejemplo n.º 1
0
        private PoolPage CreateSubpagePoolHead()
        {
            var head = new PoolPage(_pageSize);

            head.Prev = head;
            head.Next = head;
            return(head);
        }
Ejemplo n.º 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());
        }
Ejemplo n.º 3
0
 private PoolPage CreateSubpagePoolHead()
 {
     var head = new PoolPage(_pageSize);
     head.Prev = head;
     head.Next = head;
     return head;
 }
Ejemplo n.º 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();
        }