public inbox for git@vger.kernel.org 
 help / color / mirror / Atom feed
From: Junio C Hamano <gitster@pobox•com>
To: Jeff King <peff@peff•net>
Cc: git@vger•kernel.org
Subject: Re: [PATCH] pathspec: rename free_pathspec() to clear_pathspec()
Date: Thu, 02 Jun 2016 15:03:15 -0700	[thread overview]
Message-ID: <xmqqinxrs0yk.fsf@gitster.mtv.corp.google.com> (raw)
In-Reply-To: <20160602212938.GA13071@sigill.intra.peff.net> (Jeff King's message of "Thu, 2 Jun 2016 17:29:38 -0400")

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.

      reply	other threads:[~2016-06-02 22:03 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-06-02 21:18 [PATCH] pathspec: rename free_pathspec() to clear_pathspec() Junio C Hamano
2016-06-02 21:29 ` Jeff King
2016-06-02 22:03   ` Junio C Hamano [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=xmqqinxrs0yk.fsf@gitster.mtv.corp.google.com \
    --to=gitster@pobox$(echo .)com \
    --cc=git@vger$(echo .)kernel.org \
    --cc=peff@peff$(echo .)net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox