Re: [PATCH 2/2] index-pack: kill union delta_base to save memory

2015-07-05 Thread Junio C Hamano
Duy Nguyen pclo...@gmail.com writes: @@ -1282,28 +1344,25 @@ static void fix_unresolved_deltas(struct sha1file *f, int nr_unresolved) * resolving deltas in the same order as their position in the pack. */ sorted_by_pos = xmalloc(nr_unresolved * sizeof(*sorted_by_pos));

Re: [PATCH 2/2] index-pack: kill union delta_base to save memory

2015-07-03 Thread Duy Nguyen
On Fri, Jul 3, 2015 at 11:51 PM, Junio C Hamano gits...@pobox.com wrote: Nguyễn Thái Ngọc Duy pclo...@gmail.com writes: Once we know the number of objects in the input pack, we allocate an array of nr_objects of struct delta_entry. On x86-64, this struct is 32 bytes long. The union

Re: [PATCH 2/2] index-pack: kill union delta_base to save memory

2015-07-03 Thread Junio C Hamano
Nguyễn Thái Ngọc Duy pclo...@gmail.com writes: Once we know the number of objects in the input pack, we allocate an array of nr_objects of struct delta_entry. On x86-64, this struct is 32 bytes long. The union delta_base, which is part of struct delta_entry, provides enough space to store

[PATCH 2/2] index-pack: kill union delta_base to save memory

2015-04-18 Thread Nguyễn Thái Ngọc Duy
Once we know the number of objects in the input pack, we allocate an array of nr_objects of struct delta_entry. On x86-64, this struct is 32 bytes long. The union delta_base, which is part of struct delta_entry, provides enough space to store either ofs-delta (8 bytes) or ref-delta (20 bytes).