| 2050 | } |
| 2051 | |
| 2052 | static 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 |
no test coverage detected