valgrind stuff

Tony Arcieri tony at
Wed Apr 9 23:09:54 CEST 2008

On Wed, Apr 9, 2008 at 2:57 PM, Marc Lehmann <schmorp at> wrote:

> > Also, the default ev_realloc() does a realloc to zero for allocs of size
> > zero, instead of an actual free(), which results in valgrind reporting a
> > bunch of leaks of size zero at exit.  Glibc's docs say realloc() to zero
> actually, realloc is defined to be free in that case in the C programming
> language.

I'm noticing some disparity in how that's actually handled across various

glibc: if size is equal to zero, the call is equivalent to free(ptr).*

*OpenBSD: If size is zero and ptr is not a null pointer, the object it
points to is freed and a new zero size object is returned.

Darwin: If size is zero and ptr is not NULL, a new, minimum sized object is
allocated and the original object is freed.

Tony Arcieri
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <>

More information about the libev mailing list