Lines Matching refs:Offset

106     RopePieceBTreeNode *split(unsigned Offset);
114 RopePieceBTreeNode *insert(unsigned Offset, const RopePiece &R);
118 void erase(unsigned Offset, unsigned NumBytes);
207 RopePieceBTreeNode *split(unsigned Offset);
215 RopePieceBTreeNode *insert(unsigned Offset, const RopePiece &R);
220 void erase(unsigned Offset, unsigned NumBytes);
234 RopePieceBTreeNode *RopePieceBTreeLeaf::split(unsigned Offset) { in split() argument
237 if (Offset == 0 || Offset == size()) { in split()
245 while (Offset >= PieceOffs+Pieces[i].size()) { in split()
252 if (PieceOffs == Offset) in split()
257 unsigned IntraPieceOffset = Offset-PieceOffs; in split()
266 return insert(Offset, Tail); in split()
275 RopePieceBTreeNode *RopePieceBTreeLeaf::insert(unsigned Offset, in insert() argument
282 if (Offset == size()) { in insert()
287 for (; Offset > SlotOffs; ++i) in insert()
289 assert(SlotOffs == Offset && "Split didn't occur before insertion!"); in insert()
327 if (this->size() >= Offset) in insert()
328 this->insert(Offset, R); in insert()
330 NewNode->insert(Offset - this->size(), R); in insert()
336 void RopePieceBTreeLeaf::erase(unsigned Offset, unsigned NumBytes) { in erase() argument
341 for (; Offset > PieceOffs; ++i) in erase()
343 assert(PieceOffs == Offset && "Split didn't occur before erase!"); in erase()
349 for (; Offset+NumBytes > PieceOffs+getPiece(i).size(); ++i) in erase()
353 if (Offset+NumBytes == PieceOffs+getPiece(i).size()) in erase()
367 unsigned CoverBytes = PieceOffs-Offset; in erase()
439 RopePieceBTreeNode *split(unsigned Offset);
448 RopePieceBTreeNode *insert(unsigned Offset, const RopePiece &R);
456 void erase(unsigned Offset, unsigned NumBytes);
470 RopePieceBTreeNode *RopePieceBTreeInterior::split(unsigned Offset) { in split() argument
472 if (Offset == 0 || Offset == size()) in split()
477 for (; Offset >= ChildOffset+getChild(i)->size(); ++i) in split()
481 if (ChildOffset == Offset) in split()
485 if (RopePieceBTreeNode *RHS = getChild(i)->split(Offset-ChildOffset)) in split()
496 RopePieceBTreeNode *RopePieceBTreeInterior::insert(unsigned Offset, in insert() argument
503 if (Offset == size()) { in insert()
508 for (; Offset > ChildOffs+getChild(i)->size(); ++i) in insert()
515 if (RopePieceBTreeNode *RHS = getChild(i)->insert(Offset-ChildOffs, R)) in insert()
565 void RopePieceBTreeInterior::erase(unsigned Offset, unsigned NumBytes) { in erase() argument
571 for (; Offset >= getChild(i)->size(); ++i) in erase()
572 Offset -= getChild(i)->size(); in erase()
581 if (Offset+NumBytes < CurChild->size()) { in erase()
582 CurChild->erase(Offset, NumBytes); in erase()
588 if (Offset) { in erase()
589 unsigned BytesFromChild = CurChild->size()-Offset; in erase()
590 CurChild->erase(Offset, BytesFromChild); in erase()
593 Offset = 0; in erase()
626 RopePieceBTreeNode *RopePieceBTreeNode::split(unsigned Offset) { in split() argument
627 assert(Offset <= size() && "Invalid offset to split!"); in split()
629 return Leaf->split(Offset); in split()
630 return cast<RopePieceBTreeInterior>(this)->split(Offset); in split()
639 RopePieceBTreeNode *RopePieceBTreeNode::insert(unsigned Offset, in insert() argument
641 assert(Offset <= size() && "Invalid offset to insert!"); in insert()
643 return Leaf->insert(Offset, R); in insert()
644 return cast<RopePieceBTreeInterior>(this)->insert(Offset, R); in insert()
649 void RopePieceBTreeNode::erase(unsigned Offset, unsigned NumBytes) { in erase() argument
650 assert(Offset+NumBytes <= size() && "Invalid offset to erase!"); in erase()
652 return Leaf->erase(Offset, NumBytes); in erase()
653 return cast<RopePieceBTreeInterior>(this)->erase(Offset, NumBytes); in erase()
739 void RopePieceBTree::insert(unsigned Offset, const RopePiece &R) { in insert() argument
741 if (RopePieceBTreeNode *RHS = getRoot(Root)->split(Offset)) in insert()
745 if (RopePieceBTreeNode *RHS = getRoot(Root)->insert(Offset, R)) in insert()
749 void RopePieceBTree::erase(unsigned Offset, unsigned NumBytes) { in erase() argument
751 if (RopePieceBTreeNode *RHS = getRoot(Root)->split(Offset)) in erase()
755 getRoot(Root)->erase(Offset, NumBytes); in erase()