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