Skip to content

Commit 2678a73

Browse files
ttaylorrgitster
authored andcommitted
midx: add new fields for incremental MIDX chains
The incremental MIDX chain feature is designed around the idea of indexing into a concatenated lexicographic ordering of object IDs present in the MIDX. When given an object position, the MIDX machinery needs to be able to locate both (a) which MIDX layer contains the given object, and (b) at what position *within that MIDX layer* that object appears. To do this, three new fields are added to the `struct multi_pack_index`: - struct multi_pack_index *base_midx; - uint32_t num_objects_in_base; - uint32_t num_packs_in_base; These three fields store the pieces of information suggested by their respective field names. In turn, the `num_objects_in_base` and `num_packs_in_base` fields are used to crawl backwards along the `base_midx` pointer to locate the appropriate position for a given object within the MIDX that contains it. The following commits will update various parts of the MIDX machinery (as well as their callers from outside of midx.c and midx-write.c) to be aware and make use of these fields when performing object lookups. Signed-off-by: Taylor Blau <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 6eb1a7d commit 2678a73

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

midx.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,10 @@ struct multi_pack_index {
6363
const unsigned char *chunk_revindex;
6464
size_t chunk_revindex_len;
6565

66+
struct multi_pack_index *base_midx;
67+
uint32_t num_objects_in_base;
68+
uint32_t num_packs_in_base;
69+
6670
const char **pack_names;
6771
struct packed_git **packs;
6872
char object_dir[FLEX_ARRAY];

0 commit comments

Comments
 (0)