Re: [PATCH v7 06/13] pack-objects: move in_pack out of struct object_entry

2018-03-31 Thread Duy Nguyen
On Sat, Mar 31, 2018 at 06:20:07AM -0400, Jeff King wrote: > On Sat, Mar 31, 2018 at 06:51:10AM +0200, Duy Nguyen wrote: > > > >> +#define IN_PACK(obj) oe_in_pack(_pack, obj) > > > > > > How come this one gets a macro, but the earlier conversions don't? > > > > > > I guess the problem is that

Re: [PATCH v7 06/13] pack-objects: move in_pack out of struct object_entry

2018-03-31 Thread Jeff King
On Sat, Mar 31, 2018 at 06:51:10AM +0200, Duy Nguyen wrote: > >> +#define IN_PACK(obj) oe_in_pack(_pack, obj) > > > > How come this one gets a macro, but the earlier conversions don't? > > > > I guess the problem is that oe_in_pack() is defined in the generic > > pack-objects.h, but _pack is only

Re: [PATCH v7 06/13] pack-objects: move in_pack out of struct object_entry

2018-03-30 Thread Duy Nguyen
On Fri, Mar 30, 2018 at 10:48 PM, Jeff King wrote: > On Sat, Mar 24, 2018 at 07:33:46AM +0100, Nguyễn Thái Ngọc Duy wrote: > >> diff --git a/builtin/pack-objects.c b/builtin/pack-objects.c >> index e1244918a5..b41610569e 100644 >> --- a/builtin/pack-objects.c >> +++

Re: [PATCH v7 06/13] pack-objects: move in_pack out of struct object_entry

2018-03-30 Thread Jeff King
On Sat, Mar 24, 2018 at 07:33:46AM +0100, Nguyễn Thái Ngọc Duy wrote: > diff --git a/builtin/pack-objects.c b/builtin/pack-objects.c > index e1244918a5..b41610569e 100644 > --- a/builtin/pack-objects.c > +++ b/builtin/pack-objects.c > @@ -29,6 +29,8 @@ > #include "list.h" > #include

Re: [PATCH v7 06/13] pack-objects: move in_pack out of struct object_entry

2018-03-24 Thread Duy Nguyen
On Sat, Mar 24, 2018 at 10:42 AM, Ævar Arnfjörð Bjarmason wrote: > > On Sat, Mar 24 2018, Nguyễn Thái Ngọc Duy wrote: > >> + if (pack->in_pack_by_idx) { >> + if (p->index <= 0) >> + die("BUG: found_pack should be NULL " >> +

Re: [PATCH v7 06/13] pack-objects: move in_pack out of struct object_entry

2018-03-24 Thread Ævar Arnfjörð Bjarmason
On Sat, Mar 24 2018, Nguyễn Thái Ngọc Duy wrote: > Instead of using 8 bytes (on 64 bit arch) to store a pointer to a > pack. Use an index instead since the number of packs should be > relatively small. > > This limits the number of packs we can handle to 1k. Since we can't be > sure people can

Re: [PATCH v7 06/13] pack-objects: move in_pack out of struct object_entry

2018-03-24 Thread Ævar Arnfjörð Bjarmason
On Sat, Mar 24 2018, Nguyễn Thái Ngọc Duy wrote: > + if (pack->in_pack_by_idx) { > + if (p->index <= 0) > + die("BUG: found_pack should be NULL " > + "instead of having non-positive index"); > +

[PATCH v7 06/13] pack-objects: move in_pack out of struct object_entry

2018-03-24 Thread Nguyễn Thái Ngọc Duy
Instead of using 8 bytes (on 64 bit arch) to store a pointer to a pack. Use an index instead since the number of packs should be relatively small. This limits the number of packs we can handle to 1k. Since we can't be sure people can never run into the situation where they have more than 1k pack