On Sat, May 12, 2018 at 02:09:18PM +0200, Duy Nguyen wrote:
> > That wastes an extra 4 bytes per slot over storing an int directly, but
> > it's the same as storing an 8-byte pointer, plus you avoid the storage
> > and runtime overhead of malloc.
>
> Or we could have a way to let the user decide
On Sat, May 12, 2018 at 11:18 AM, Jeff King wrote:
> On Sat, May 12, 2018 at 05:07:48AM -0400, Jeff King wrote:
>
>> So no, it wouldn't work to directly store depths with the code as
>> written. I'm not sure if the depth can ever be 0. If not, then it would
>> be a suitable sentinel as:
>>
>> i
On Sat, May 12, 2018 at 11:07 AM, Jeff King wrote:
> On Sat, May 12, 2018 at 10:00:19AM +0200, Nguyễn Thái Ngọc Duy wrote:
>
>> @@ -82,25 +84,29 @@ struct commit_list *get_shallow_commits(struct
>> object_array *heads, int depth,
>> struct object_array stack = OBJECT_ARRAY_INIT;
>> st
On Sat, May 12, 2018 at 05:07:48AM -0400, Jeff King wrote:
> So no, it wouldn't work to directly store depths with the code as
> written. I'm not sure if the depth can ever be 0. If not, then it would
> be a suitable sentinel as:
>
> int *slot = commit_depth_at(&depths, p->item);
> if (!*slo
On Sat, May 12, 2018 at 10:00:19AM +0200, Nguyễn Thái Ngọc Duy wrote:
> @@ -82,25 +84,29 @@ struct commit_list *get_shallow_commits(struct
> object_array *heads, int depth,
> struct object_array stack = OBJECT_ARRAY_INIT;
> struct commit *commit = NULL;
> struct commit_graft *gr
It's done so that commit->util can be removed. See more explanation in
the commit that removes commit->util.
While at there, plug a leak for keeping track of depth in this code.
Signed-off-by: Nguyễn Thái Ngọc Duy
---
shallow.c | 37 +
1 file changed, 25 inse
6 matches
Mail list logo