Re: [PATCH v3 08/28] shallow.c: add mark_new_shallow_refs()

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Duy Nguyen <pclouds@xxxxxxxxx> writes:

> On Tue, Nov 26, 2013 at 5:20 AM, Junio C Hamano <gitster@xxxxxxxxx> wrote:
>> Hmph.  the use of ->util field in this patch feels that it was
>> something commit-slab data structure was invented to solve.
>
> Good stuff! Thanks.
>
>>> +             if (c->util == NULL)
>>> +                     c->util = bitmap;
>>> +             else {
>>> +                     /*
>>> +                      * Deliberately leak a lot in commit->util
>>> +                      * because there can be many pointers to the
>>> +                      * same bitmap. Probably should allocate in a
>>> +                      * pool and free the whole pool at the end.
>>> +                      */
>>
>> ... or perhaps make the bitmap into
>>
>>         struct {
>>                 int refcnt;
>>                 uint32_t bits[FLEX_ARRAY];
>>         }
>>
>> and refcnt them?
>
> I still prefer memory pools so I just need to do a few free() than
> walking through all the commits again and refcnt-- or free() them.

Fair enough.

> Sorry to break the patches this way and lose the overall call flow.
> It's just too big to put all into one patch. 13/28 is the one that put
> the pieces together but basically
>
>  1. receive the remote's .git/shallow
>  2. call remote_reachable_shallow_points() to exclude our shallow commits
>  3. get the pack and install it (or unpack it)
>  4. call this function to determine what new ref needs new shallow
> commits from the result of #2

Thanks for a roadmap.  Will find time to re-read the thing with it.

--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]