page returns a reference to the page with a given id. If page has been written to then a temporary buffered page is returned.
(id common.Pgid)
| 627 | // page returns a reference to the page with a given id. |
| 628 | // If page has been written to then a temporary buffered page is returned. |
| 629 | func (tx *Tx) page(id common.Pgid) *common.Page { |
| 630 | // Check the dirty pages first. |
| 631 | if tx.pages != nil { |
| 632 | if p, ok := tx.pages[id]; ok { |
| 633 | p.FastCheck(id) |
| 634 | return p |
| 635 | } |
| 636 | } |
| 637 | |
| 638 | // Otherwise return directly from the mmap. |
| 639 | p := tx.db.page(id) |
| 640 | p.FastCheck(id) |
| 641 | return p |
| 642 | } |
| 643 | |
| 644 | // forEachPage iterates over every page within a given page and executes a function. |
| 645 | func (tx *Tx) forEachPage(pgidnum common.Pgid, fn func(*common.Page, int, []common.Pgid)) { |
no test coverage detected