memory leak or something wrong

Marc Lehmann schmorp at
Tue Jun 19 14:14:25 CEST 2012

On Mon, Jun 18, 2012 at 04:50:22PM -0500, Brandon Black <blblack at> wrote:
> the Data size, but valgrind won't report it.  However, whether it's a
> simple bug or somehow intentional behavior is unclear to me given all
> that arguing about malloc(p,0) between glibc/C/POSIX people.

The documented behaviour is allowed in any case - you don't have to break
realloc, you just can, according to iso c :)

> Using ev_set_allocator() to transform realloc(p,0) into free(p) calls
> stops the growth.

People should report that to their distributions, so that bug can be
fixed, preferably by making realloc follow the documentation, as libev is
likely not the only program to rely on documented behaviour here.

                The choice of a       Deliantra, the free code+content MORPG
      -----==-     _GNU_    
      ----==-- _       generation
      ---==---(_)__  __ ____  __      Marc Lehmann
      --==---/ / _ \/ // /\ \/ /      schmorp at
      -=====/_/_//_/\_,_/ /_/\_\

More information about the libev mailing list