Re: [PATCH 1/2] commit-graph: clean up leaked memory during write

2018-10-03 Thread Derrick Stolee
On 10/2/2018 6:44 PM, Stefan Beller wrote: My preference is to avoid them in the name of simplicity. If you're using "make SANITIZE=leak test" to check for leaks, it will skip these cases. If you're using valgrind, I think these may be reported as "reachable". But that number already isn't useful

Re: [PATCH 1/2] commit-graph: clean up leaked memory during write

2018-10-02 Thread Stefan Beller
> > My preference is to avoid them in the name of simplicity. If you're > using "make SANITIZE=leak test" to check for leaks, it will skip these > cases. If you're using valgrind, I think these may be reported as > "reachable". But that number already isn't useful for finding real > leaks, because

Re: [PATCH 1/2] commit-graph: clean up leaked memory during write

2018-10-02 Thread Jeff King
On Tue, Oct 02, 2018 at 10:59:28AM -0700, Stefan Beller wrote: > > Generally speaking, it > > seems impossible to UNLEAK when dying, since we don't know what we have > > allocated higher up in the call-stack. > > I do not understand; I thought UNLEAK was specifically for the purpose of > die() ca

Re: [PATCH 1/2] commit-graph: clean up leaked memory during write

2018-10-02 Thread Jeff King
On Tue, Oct 02, 2018 at 12:44:09PM -0700, Stefan Beller wrote: > > My worry is that one of these would seem to be true: > > > > * UNLEAK is unsuitable for the job. Whenever we have a `die()` as we do > > here, we can UNLEAK the variables we know of, but we can't do anything > > about the alloc

Re: [PATCH 1/2] commit-graph: clean up leaked memory during write

2018-10-02 Thread Stefan Beller
On Tue, Oct 2, 2018 at 12:09 PM Martin Ågren wrote: > > On Tue, 2 Oct 2018 at 19:59, Stefan Beller wrote: > > > > + > > > > + string_list_clear(&list, 0); > > > > } > > > > > > Nit: The blank line adds some asymmetry, IMVHO. > > > > I think these blank lines are super common, as in: > > >

Re: [PATCH 1/2] commit-graph: clean up leaked memory during write

2018-10-02 Thread Martin Ågren
On Tue, 2 Oct 2018 at 19:59, Stefan Beller wrote: > > > + > > > + string_list_clear(&list, 0); > > > } > > > > Nit: The blank line adds some asymmetry, IMVHO. > > I think these blank lines are super common, as in: > > { > declarations; > > multiple; > lines(of); >

Re: [PATCH 1/2] commit-graph: clean up leaked memory during write

2018-10-02 Thread Stefan Beller
On Tue, Oct 2, 2018 at 8:40 AM Martin Ågren wrote: > > On Tue, 2 Oct 2018 at 17:01, Derrick Stolee via GitGitGadget > wrote: > > diff --git a/commit-graph.c b/commit-graph.c > > index 2a24eb8b5a..7226bd6b58 100644 > > --- a/commit-graph.c > > +++ b/commit-graph.c > > @@ -698,6 +698,8 @@ void writ

Re: [PATCH 1/2] commit-graph: clean up leaked memory during write

2018-10-02 Thread Martin Ågren
On Tue, 2 Oct 2018 at 17:01, Derrick Stolee via GitGitGadget wrote: > diff --git a/commit-graph.c b/commit-graph.c > index 2a24eb8b5a..7226bd6b58 100644 > --- a/commit-graph.c > +++ b/commit-graph.c > @@ -698,6 +698,8 @@ void write_commit_graph_reachable(const char *obj_dir, > int append, >

[PATCH 1/2] commit-graph: clean up leaked memory during write

2018-10-02 Thread Derrick Stolee via GitGitGadget
From: Derrick Stolee The write_commit_graph() method in commit-graph.c leaks some lits and strings during execution. In addition, a list of strings is leaked in write_commit_graph_reachable(). Clean these up so our memory checking is cleaner. Running 'valgrind --leak-check=full git commit-graph