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

Function load_all_cache_entries

read-cache.c:2052–2069  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2050}
2051
2052static unsigned long load_all_cache_entries(struct index_state *istate,
2053 const char *mmap, size_t mmap_size, unsigned long src_offset)
2054{
2055 unsigned long consumed;
2056
2057 istate->ce_mem_pool = xmalloc(sizeof(*istate->ce_mem_pool));
2058 if (istate->version == 4) {
2059 mem_pool_init(istate->ce_mem_pool,
2060 estimate_cache_size_from_compressed(istate->cache_nr));
2061 } else {
2062 mem_pool_init(istate->ce_mem_pool,
2063 estimate_cache_size(mmap_size, istate->cache_nr));
2064 }
2065
2066 consumed = load_cache_entry_block(istate, istate->ce_mem_pool,
2067 0, istate->cache_nr, mmap, src_offset, NULL);
2068 return consumed;
2069}
2070
2071/*
2072 * Mostly randomly chosen maximum thread counts: we

Callers 1

do_read_indexFunction · 0.85

Calls 5

mem_pool_initFunction · 0.85
estimate_cache_sizeFunction · 0.85
load_cache_entry_blockFunction · 0.85
xmallocFunction · 0.70

Tested by

no test coverage detected