| 337 | } |
| 338 | |
| 339 | static void scan_windows(struct packed_git *p, |
| 340 | struct packed_git **lru_p, |
| 341 | struct pack_window **lru_w, |
| 342 | struct pack_window **lru_l) |
| 343 | { |
| 344 | struct pack_window *w, *w_l; |
| 345 | |
| 346 | for (w_l = NULL, w = p->windows; w; w = w->next) { |
| 347 | if (!w->inuse_cnt) { |
| 348 | if (!*lru_w || w->last_used < (*lru_w)->last_used) { |
| 349 | *lru_p = p; |
| 350 | *lru_w = w; |
| 351 | *lru_l = w_l; |
| 352 | } |
| 353 | } |
| 354 | w_l = w; |
| 355 | } |
| 356 | } |
| 357 | |
| 358 | static int unuse_one_window(struct object_database *odb) |
| 359 | { |