summaryrefslogtreecommitdiff
path: root/pack-objects.h
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2018-09-17 20:53:53 (GMT)
committerJunio C Hamano <gitster@pobox.com>2018-09-17 20:53:53 (GMT)
commit3ebdef2e1b4c89fd193140b36c04b41eb7f9a86d (patch)
tree8b447f11ebd9e31d6c1c1a7ac5522c0c327fb810 /pack-objects.h
parent7e794d0a3f7ad4a37541539b823d5b9afdc10ce3 (diff)
parent6a1e32d532c5948071e322cefc7052be6228adc3 (diff)
downloadgit-3ebdef2e1b4c89fd193140b36c04b41eb7f9a86d.zip
git-3ebdef2e1b4c89fd193140b36c04b41eb7f9a86d.tar.gz
git-3ebdef2e1b4c89fd193140b36c04b41eb7f9a86d.tar.bz2
Merge branch 'jk/pack-delta-reuse-with-bitmap'
When creating a thin pack, which allows objects to be made into a delta against another object that is not in the resulting pack but is known to be present on the receiving end, the code learned to take advantage of the reachability bitmap; this allows the server to send a delta against a base beyond the "boundary" commit. * jk/pack-delta-reuse-with-bitmap: pack-objects: reuse on-disk deltas for thin "have" objects pack-bitmap: save "have" bitmap from walk t/perf: add perf tests for fetches from a bitmapped server t/perf: add infrastructure for measuring sizes t/perf: factor out percent calculations t/perf: factor boilerplate out of test_perf
Diffstat (limited to 'pack-objects.h')
-rw-r--r--pack-objects.h20
1 files changed, 18 insertions, 2 deletions
diff --git a/pack-objects.h b/pack-objects.h
index 62806cc..b0c1f13 100644
--- a/pack-objects.h
+++ b/pack-objects.h
@@ -112,6 +112,7 @@ struct object_entry {
unsigned filled:1; /* assigned write-order */
unsigned dfs_state:OE_DFS_STATE_BITS;
unsigned depth:OE_DEPTH_BITS;
+ unsigned ext_base:1; /* delta_idx points outside packlist */
/*
* pahole results on 64-bit linux (gcc and clang)
@@ -147,6 +148,14 @@ struct packing_data {
pthread_mutex_t lock;
#endif
+ /*
+ * This list contains entries for bases which we know the other side
+ * has (e.g., via reachability bitmaps), but which aren't in our
+ * "objects" list.
+ */
+ struct object_entry *ext_bases;
+ uint32_t nr_ext, alloc_ext;
+
uintmax_t oe_size_limit;
uintmax_t oe_delta_size_limit;
};
@@ -249,9 +258,12 @@ static inline struct object_entry *oe_delta(
const struct packing_data *pack,
const struct object_entry *e)
{
- if (e->delta_idx)
+ if (!e->delta_idx)
+ return NULL;
+ if (e->ext_base)
+ return &pack->ext_bases[e->delta_idx - 1];
+ else
return &pack->objects[e->delta_idx - 1];
- return NULL;
}
static inline void oe_set_delta(struct packing_data *pack,
@@ -264,6 +276,10 @@ static inline void oe_set_delta(struct packing_data *pack,
e->delta_idx = 0;
}
+void oe_set_delta_ext(struct packing_data *pack,
+ struct object_entry *e,
+ const unsigned char *sha1);
+
static inline struct object_entry *oe_delta_child(
const struct packing_data *pack,
const struct object_entry *e)