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

Re: [RFC] get_pathspec(): free() old buffer if rewriting

From
Johannes Schindelin <johannes.schindelin@gmx.de>
Date
May 6, 2006, 22:44 UTC
Message-ID
<Pine.LNX.4.63.0605070041540.26058@wbgn013.biozentrum.uni-wuerzburg.de>
In-Reply-To
<Pine.LNX.4.64.0605061532190.16343@g5.osdl.org>
Hi,
On Sat, 6 May 2006, Linus Torvalds wrote:
Show 10 quoted lines
> On Sun, 7 May 2006, Johannes Schindelin wrote:
> > 
> > This might be the wrong way to do it, but as it is without this patch,
> > get_pathspec() is leaking memory.
> 
> I'm not at all convinced we want to do somethng like this.
> 
> get_pathspec() is a one-time event. It doesn't "leak" memory. To me, 
> "leaking" is when you continually lose a bit of memory, and you eventually 
> run out. I don't see that happening here.

I see your point. That was exactly why I put "RFC" and not "PATCH" on the subject.

> So there's a difference between "don't care" and "leak memory". It sounds 
> like you may be using some automated tool that warns because it simply 
> doesn't understand that difference.

Nope. No automated tool. Just my brain which wanted to fix _all_ occurrences of that prefix_path() usage bug.

But in case anybody uses Valgrind et al. on git, how about at least a comment telling the casual observer why we don't free() the buffers?

Ciao, Dscho

Previous: Linus TorvaldsNext: Junio C Hamano
Message 3 of 5 in “[RFC] get_pathspec(): free() old buffer if rewriting”
  1. Johannes SchindelinMay 6, 2006
  2. Linus TorvaldsMay 6, 2006
  3. Johannes SchindelinMay 6, 2006
  4. Junio C HamanoMay 7, 2006
  5. Junio C HamanoMay 7, 2006

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.