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

Function load_cache_entry_block

read-cache.c:2030–2050  ·  view source on GitHub ↗

* A helper function that will load the specified range of cache entries * from the memory mapped file and add them to the given index. */

Source from the content-addressed store, hash-verified

2028 * from the memory mapped file and add them to the given index.
2029 */
2030static unsigned long load_cache_entry_block(struct index_state *istate,
2031 struct mem_pool *ce_mem_pool, int offset, int nr, const char *mmap,
2032 unsigned long start_offset, const struct cache_entry *previous_ce)
2033{
2034 int i;
2035 unsigned long src_offset = start_offset;
2036
2037 for (i = offset; i < offset + nr; i++) {
2038 struct cache_entry *ce;
2039 unsigned long consumed;
2040
2041 ce = create_from_disk(ce_mem_pool, istate->version,
2042 mmap + src_offset,
2043 &consumed, previous_ce);
2044 set_index_entry(istate, i, ce);
2045
2046 src_offset += consumed;
2047 previous_ce = ce;
2048 }
2049 return src_offset - start_offset;
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)

Callers 2

load_all_cache_entriesFunction · 0.85

Calls 2

create_from_diskFunction · 0.85
set_index_entryFunction · 0.70

Tested by

no test coverage detected