| 44 | } |
| 45 | |
| 46 | void Allocation::append(uint8_t* address, MachinePageCount numPages) { |
| 47 | BOLT_CHECK( |
| 48 | runs_.empty() || address != runs_.back().data(), |
| 49 | "Appending a duplicate address into a PageRun"); |
| 50 | if (FOLLY_UNLIKELY(numPages > Allocation::PageRun::kMaxPagesInRun)) { |
| 51 | BOLT_MEM_ALLOC_ERROR(fmt::format( |
| 52 | "The number of pages to append {} exceeds the PageRun limit {}", |
| 53 | numPages, |
| 54 | Allocation::PageRun::kMaxPagesInRun)); |
| 55 | } |
| 56 | numPages_ += numPages; |
| 57 | runs_.emplace_back(address, numPages); |
| 58 | } |
| 59 | |
| 60 | void Allocation::appendMove(Allocation& other) { |
| 61 | for (auto& run : other.runs_) { |