| 219 | } |
| 220 | |
| 221 | func (t *shared) NoSyncReload(pgIds common.Pgids) { |
| 222 | // Build a cache of only pending pages. |
| 223 | pcache := make(map[common.Pgid]struct{}) |
| 224 | for _, txp := range t.pending { |
| 225 | for _, pendingID := range txp.ids { |
| 226 | pcache[pendingID] = struct{}{} |
| 227 | } |
| 228 | } |
| 229 | |
| 230 | // Check each page in the freelist and build a new available freelist |
| 231 | // with any pages not in the pending lists. |
| 232 | a := []common.Pgid{} |
| 233 | for _, id := range pgIds { |
| 234 | if _, ok := pcache[id]; !ok { |
| 235 | a = append(a, id) |
| 236 | } |
| 237 | } |
| 238 | |
| 239 | t.Init(a) |
| 240 | } |
| 241 | |
| 242 | // reindex rebuilds the free cache based on available and pending free lists. |
| 243 | func (t *shared) reindex() { |