On Sun, Nov 10, 2024 at 10:47:58PM +0100, Rubén Justo wrote:
Show 29 quoted lines
> On Wed, Nov 06, 2024 at 04:11:21PM +0100, Patrick Steinhardt wrote:
> > There are two users of `UNLEAK()` left in our codebase:
> >
> > - In "builtin/clone.c", annotating the `repo` variable. That leak has
> > already been fixed though as you can see in the context, where we do
> > know to free `repo_to_free`.
> >
> > - In "builtin/diff.c", to unleak entries of the `blob[]` array. That
> > leak has also been fixed, because the entries we assign to that
> > array come from `rev.pending.objects`, and we do eventually release
> > `rev`.
> >
> > This neatly demonstrates one of the issues with `UNLEAK()`: it is quite
> > easy for the annotation to become stale. A second issue is that its
> > whole intent is to paper over leaks. And while that has been a necessary
> > evil in the past, because Git was leaking left and right, it isn't
> > really much of an issue nowadays where our test suite has no known leaks
> > anymore.
> >
> > Remove the last two users
>
> OK.
>
> > and drop the now-unused `UNLEAK()` annotation.
>
> Perhaps it would be convenient to do this as a separate commit.
>
> Just for reference we have this annotation since 0e5bba53af (add
> UNLEAK annotation for reducing leak false positives, 2017-09-08).