diff options
author | Nguyễn Thái Ngọc Duy <pclouds@gmail.com> | 2018-04-14 15:35:04 (GMT) |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2018-04-16 03:38:58 (GMT) |
commit | 06af3bba414b832fe9e04fb959daa2b9b678d2d5 (patch) | |
tree | 046541620f73e0ba8ab322c20190252bbff4955d /pack-objects.h | |
parent | b5c0cbd8083f71e071207fca0d5434c6db6ff6c9 (diff) | |
download | git-06af3bba414b832fe9e04fb959daa2b9b678d2d5.zip git-06af3bba414b832fe9e04fb959daa2b9b678d2d5.tar.gz git-06af3bba414b832fe9e04fb959daa2b9b678d2d5.tar.bz2 |
pack-objects: move in_pack_pos out of struct object_entry
This field is only need for pack-bitmap, which is an optional
feature. Move it to a separate array that is only allocated when
pack-bitmap is used (like objects[], it is not freed, since we need it
until the end of the process)
Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'pack-objects.h')
-rw-r--r-- | pack-objects.h | 16 |
1 files changed, 15 insertions, 1 deletions
diff --git a/pack-objects.h b/pack-objects.h index cdce164..71ea992 100644 --- a/pack-objects.h +++ b/pack-objects.h @@ -79,7 +79,6 @@ struct object_entry { unsigned in_pack_type:TYPE_BITS; /* could be delta */ unsigned type_valid:1; uint32_t hash; /* name hint hash */ - unsigned int in_pack_pos; unsigned char in_pack_header_size; unsigned preferred_base:1; /* * we do not pack this, but is available @@ -99,6 +98,8 @@ struct packing_data { int32_t *index; uint32_t index_size; + + unsigned int *in_pack_pos; }; struct object_entry *packlist_alloc(struct packing_data *pdata, @@ -144,4 +145,17 @@ static inline void oe_set_type(struct object_entry *e, e->type_ = (unsigned)type; } +static inline unsigned int oe_in_pack_pos(const struct packing_data *pack, + const struct object_entry *e) +{ + return pack->in_pack_pos[e - pack->objects]; +} + +static inline void oe_set_in_pack_pos(const struct packing_data *pack, + const struct object_entry *e, + unsigned int pos) +{ + pack->in_pack_pos[e - pack->objects] = pos; +} + #endif |