| 666 | } |
| 667 | |
| 668 | Status Sorter::Run::TryAddPage( |
| 669 | AddPageMode mode, vector<Page>* page_sequence, bool* added) { |
| 670 | DCHECK(!page_sequence->empty()); |
| 671 | if (mode == KEEP_PREV_PINNED) { |
| 672 | if (!sorter_->buffer_pool_client_->IncreaseReservationToFit(sorter_->page_len_)) { |
| 673 | *added = false; |
| 674 | return Status::OK(); |
| 675 | } |
| 676 | } else { |
| 677 | DCHECK(mode == UNPIN_PREV); |
| 678 | // Unpin the prev page to free up the memory required to pin the next page. |
| 679 | page_sequence->back().Unpin(sorter_->buffer_pool_client_); |
| 680 | } |
| 681 | |
| 682 | RETURN_IF_ERROR(AddPage(page_sequence)); |
| 683 | *added = true; |
| 684 | return Status::OK(); |
| 685 | } |
| 686 | |
| 687 | Status Sorter::Run::AddPage(vector<Page>* page_sequence) { |
| 688 | Page new_page; |
nothing calls this directly
no test coverage detected