summaryrefslogtreecommitdiff
path: root/pack-objects.h
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2018-11-21 20:39:02 +0900
committerJunio C Hamano <gitster@pobox.com>2018-11-21 20:39:02 +0900
commit7fab474656cdb5517d5b627602a54776e485ddbc (patch)
tree4550c2062221ddc3f5c480c4c627d1e1ba73fc63 /pack-objects.h
parentfde566f222bd473193d9b39b44973a013f8b48b2 (diff)
parent3949053617652693b659a933a1393f8be189f26a (diff)
downloadgit-7fab474656cdb5517d5b627602a54776e485ddbc.tar.gz
Merge branch 'cc/delta-islands'
A few issues in the implementation of "delta-islands" feature has been corrected. * cc/delta-islands: pack-objects: fix off-by-one in delta-island tree-depth computation pack-objects: zero-initialize tree_depth/layer arrays pack-objects: fix tree_depth and layer invariants
Diffstat (limited to 'pack-objects.h')
-rw-r--r--pack-objects.h4
1 files changed, 2 insertions, 2 deletions
diff --git a/pack-objects.h b/pack-objects.h
index feb6a6a05e..dc869f26c2 100644
--- a/pack-objects.h
+++ b/pack-objects.h
@@ -412,7 +412,7 @@ static inline void oe_set_tree_depth(struct packing_data *pack,
unsigned int tree_depth)
{
if (!pack->tree_depth)
- ALLOC_ARRAY(pack->tree_depth, pack->nr_objects);
+ CALLOC_ARRAY(pack->tree_depth, pack->nr_alloc);
pack->tree_depth[e - pack->objects] = tree_depth;
}
@@ -429,7 +429,7 @@ static inline void oe_set_layer(struct packing_data *pack,
unsigned char layer)
{
if (!pack->layer)
- ALLOC_ARRAY(pack->layer, pack->nr_objects);
+ CALLOC_ARRAY(pack->layer, pack->nr_alloc);
pack->layer[e - pack->objects] = layer;
}