On Wed, Feb 20, 2013 at 04:42:54PM +0100, Alexander Klauer 
<alexander.kla...@itwm.fraunhofer.de> wrote:
> #define ev_free(ptr)    ev_realloc ((ptr), 0)
> 
> This causes a memory leak on systems where zero-sized objects are

Only if the user-supplied allocator is buggy - the default implementation
calls free.

> #define ev_free(ptr)    free ((ptr))

That would be a bug - there is no reason to believe that the user-supplied
allocator is compatible with free.

-- 
                The choice of a       Deliantra, the free code+content MORPG
      -----==-     _GNU_              http://www.deliantra.net
      ----==-- _       generation
      ---==---(_)__  __ ____  __      Marc Lehmann
      --==---/ / _ \/ // /\ \/ /      schm...@schmorp.de
      -=====/_/_//_/\_,_/ /_/\_\

_______________________________________________
libev mailing list
libev@lists.schmorp.de
http://lists.schmorp.de/cgi-bin/mailman/listinfo/libev

Reply via email to