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

Re: [PATCH] pathspec: rename free_pathspec() to clear_pathspec()

From
Junio C Hamano <gitster@pobox.com>
Date
Jun 2, 2016, 22:03 UTC
Message-ID
<xmqqinxrs0yk.fsf@gitster.mtv.corp.google.com>
In-Reply-To
<20160602212938.GA13071@sigill.intra.peff.net>
Jeff King <peff@peff.net> writes:
> I think diff_filespec_clear() would not be quite right. It is freeing
> only the allocated _data_, but leaving the other portions intact.
You are (as usual) more right than I am ;-)

Yes, the free_data() is designed to retain enough information about the filespec so that the data can be re-read by the next person who needs to access it after free_data() is called; i.e. it was a measure to reduce the memory pressure by trading it off with I/O cost. It is wrong to name it "clear", which is to "clear the slate, make it into pristine state" whose side effect is to release held resources.

Previous: Jeff King
Message 3 of 3 in “pathspec: rename free_pathspec() to clear_pathspec()”
  1. pathspec: rename free_pathspec() to clear_pathspec()Junio C Hamano, Jun 2, 2016
  2. Jeff KingJun 2, 2016
  3. Junio C HamanoJun 2, 2016

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.