git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [PATCH v3] diff: support anchoring line(s)

From
JTJonathan Tan <jonathantanmy@google.com>
Date
Nov 30, 2017, 23:26 UTC
Message-ID
<20171130152605.1b775e9cc2ddd7f917424448@google.com>
In-Reply-To
<alpine.DEB.2.21.1.1711300134560.6482@virtualbox>

On Thu, 30 Nov 2017 01:36:37 +0100 (CET) Johannes Schindelin <Johannes.Schindelin@gmx.de> wrote:

Show 19 quoted lines
> Hi Jonathan,
> 
> On Tue, 28 Nov 2017, Jonathan Tan wrote:
> 
> > @@ -4607,7 +4627,14 @@ int diff_opt_parse(struct diff_options *options,
> >  		DIFF_XDL_CLR(options, NEED_MINIMAL);
> >  		options->xdl_opts &= ~XDF_DIFF_ALGORITHM_MASK;
> >  		options->xdl_opts |= value;
> > +		if (value == XDF_PATIENCE_DIFF)
> > +			clear_patience_anchors(options);
> >  		return argcount;
> > +	} else if (skip_prefix(arg, "--anchored=", &arg)) {
> > +		options->xdl_opts = DIFF_WITH_ALG(options, PATIENCE_DIFF);
> > +		ALLOC_GROW(options->anchors, options->anchors_nr + 1,
> > +			   options->anchors_alloc);
> > +		options->anchors[options->anchors_nr++] = xstrdup(arg);
> 
> I looked and failed to find the code that releases this array after the
> diff is done... did I miss anything?

You didn't miss anything. As far as I can tell, occurrences of struct diff_options live throughout the lifetime of an invocation of Git and are not freed. (Even if the struct itself is allocated on the stack, its pathspec has some elements allocated on the heap.)

Previous: Johannes SchindelinNext: Stefan Beller
Message 14 of 15 in “xdiff/xpatience: support anchoring a line”
  1. xdiff/xpatience: support anchoring a lineJonathan Tan, Nov 21, 2017
  2. Stefan BellerNov 21, 2017
  3. Junio C HamanoNov 22, 2017
  4. xdiff/xpatience: support anchoring line(s)Jonathan Tan, Nov 22, 2017
  5. Stefan BellerNov 23, 2017
  6. Junio C HamanoNov 23, 2017
  7. Junio C HamanoNov 23, 2017
  8. Junio C HamanoNov 23, 2017
  9. Jonathan TanNov 27, 2017
  10. diff: support anchoring line(s)Jonathan Tan, Nov 27, 2017
  11. Junio C HamanoNov 28, 2017
  12. diff: support anchoring line(s)Jonathan Tan, Nov 28, 2017
  13. Johannes SchindelinNov 30, 2017
  14. Jonathan TanNov 30, 2017
  15. Stefan BellerDec 4, 2017

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.