MCPcopy Create free account
hub / github.com/git/git / unuse_one_window

Function unuse_one_window

packfile.c:358–383  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

356}
357
358static int unuse_one_window(struct object_database *odb)
359{
360 struct odb_source *source;
361 struct packfile_list_entry *e;
362 struct packed_git *lru_p = NULL;
363 struct pack_window *lru_w = NULL, *lru_l = NULL;
364
365 for (source = odb->sources; source; source = source->next) {
366 struct odb_source_files *files = odb_source_files_downcast(source);
367 for (e = files->packed->packs.head; e; e = e->next)
368 scan_windows(e->pack, &lru_p, &lru_w, &lru_l);
369 }
370
371 if (lru_p) {
372 munmap(lru_w->base, lru_w->len);
373 pack_mapped -= lru_w->len;
374 if (lru_l)
375 lru_l->next = lru_w->next;
376 else
377 lru_p->windows = lru_w->next;
378 free(lru_w);
379 pack_open_windows--;
380 return 1;
381 }
382 return 0;
383}
384
385void close_pack_windows(struct packed_git *p)
386{

Callers 1

use_packFunction · 0.85

Calls 2

scan_windowsFunction · 0.85

Tested by

no test coverage detected