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

Re: [PATCH 1/2] Introduce leaky().

From
JHJan Hudec <bulb@ucw.cz>
Date
Jul 22, 2008, 18:09 UTC
Message-ID
<20080722180944.GB3561@efreet.light.src>
In-Reply-To
<20080626213304.GA22111@artemis.madism.org>
On Thu, Jun 26, 2008 at 23:33:04 +0200, Pierre Habouzit wrote:
Show 9 quoted lines
> On Thu, Jun 26, 2008 at 06:46:43PM +0000, Junio C Hamano wrote:
> > The user would also need to worry about not freeing the original
> > allocation pointer when something is realloc(3)ed, which means either
> > finding the last realloc(3) of the object (that is logically the same, but
> > just being extended) and mark the pointer as leaky() after that realloc,
> > or unregister the original pointer from leaks before calling realloc and
> > register what comes back.  It will easily get messy.
> 
>   Hmm indeed, maybe it isn't such a good idea then.

I don't think it's necessary either. Valgrind (unlike other leak detectors the poor windows folks are stuck with) is quite smart and will only report memory as leaked when there is no pointer to it. So it should not report any memory pointed to by index or any other static structure.

Additionally since valgrind allows one to write rules to exclude uninteresting reports. So a good approach would be to just keep such exclusion file around in git with the known uninteresting cases.

Show 11 quoted lines
> > By the way, the series queued in your repository still has "s/pring/print/"
> > typo in 4/7 and "argv not NULL terminated" comment in 6/7.
> 
>   I'll fix that and pushed again, without the leaky() series dependency
> (I've put in a comment that I'm aware that it's a leak), and with the
> two fixes you mention done.
> 
> -- 
> ·O·  Pierre Habouzit
> ··O                                                madcoder@debian.org
> OOO                                                http://www.madism.org
-- 
						 Jan 'Bulb' Hudec <bulb@ucw.cz>
Previous: Pierre Habouzit
Message 9 of 9 in “[RFC] leaky()”
  1. Pierre HabouzitJun 24, 2008
  2. 1/2 Introduce leaky().Pierre Habouzit, Jun 24, 2008
  3. 2/2 git-rev-parse: use leaky().Pierre Habouzit, Jun 24, 2008
  4. Pierre HabouzitJun 24, 2008
  5. Jakub NarebskiJun 24, 2008
  6. Pierre HabouzitJun 24, 2008
  7. Junio C HamanoJun 26, 2008
  8. Pierre HabouzitJun 26, 2008
  9. Jan HudecJul 22, 2008

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.