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
This commit is contained in:
Junio C Hamano
2018-11-21 20:39:02 +09:00
3 changed files with 6 additions and 3 deletions

View File

@ -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;
}