Couple of bugs

Marc Lehmann schmorp at schmorp.de
Wed Feb 25 07:42:28 CET 2009


On Mon, Feb 23, 2009 at 09:04:56AM -0500, Steve Grubb <sgrubb at redhat.com> wrote:
> OK, switching to ev_default_destroy solves most of the leaks.

So far, there has been no evidence for a leak.

> > The "leak" isn't really a leak.
> 
> Maybe not a leak in that it grows over time, but its an indication that 
> shutdown wasn't as clean as I would like. :)

That's a subjective thing. Factually, there are no leaks.

> > It's a data structure global to libev that's allocated at startup and never
> > freed, but it doesn't leak. 
> 
> This can be fixed by using a destructor (which is valid from gcc 2.7 and 
> later). The following patch allows valgrind to run cleanly.

Please do read the valgrind section in the manual.

Your patch is architecture dependend and will not work when destructors are
not working (which is not uncommon).

libev is no place for compiler-specific hacks that needlessly reduce
portability just because some tool reports a false positive (or is
misinterpreted to report a false positive).

The right fix is to teach your tool about it.

-- 
                The choice of a       Deliantra, the free code+content MORPG
      -----==-     _GNU_              http://www.deliantra.net
      ----==-- _       generation
      ---==---(_)__  __ ____  __      Marc Lehmann
      --==---/ / _ \/ // /\ \/ /      pcg at goof.com
      -=====/_/_//_/\_,_/ /_/\_\



More information about the libev mailing list