reindex rebuilds the free cache based on available and pending free lists.
()
| 241 | |
| 242 | // reindex rebuilds the free cache based on available and pending free lists. |
| 243 | func (t *shared) reindex() { |
| 244 | free := t.freePageIds() |
| 245 | pending := t.pendingPageIds() |
| 246 | t.cache = make(map[common.Pgid]struct{}, len(free)) |
| 247 | for _, id := range free { |
| 248 | t.cache[id] = struct{}{} |
| 249 | } |
| 250 | for _, txp := range pending { |
| 251 | for _, pendingID := range txp.ids { |
| 252 | t.cache[pendingID] = struct{}{} |
| 253 | } |
| 254 | } |
| 255 | } |
| 256 | |
| 257 | func (t *shared) Read(p *common.Page) { |
| 258 | if !p.IsFreelistPage() { |
no test coverage detected