]> rtime.felk.cvut.cz Git - sojka/libev.git/commitdiff
*** empty log message ***
authorMarc Alexander Lehmann <libev@schmorp.de>
Tue, 19 Jun 2012 12:29:43 +0000 (12:29 +0000)
committerMarc Alexander Lehmann <libev@schmorp.de>
Tue, 19 Jun 2012 12:29:43 +0000 (12:29 +0000)
Changes
ev.c

diff --git a/Changes b/Changes
index bf107e7785ca245b400a30451543624d83e83714..3eb5316bba1eec735cc9c5c493c2d7406296941b 100644 (file)
--- a/Changes
+++ b/Changes
@@ -37,6 +37,7 @@ TODO: ev_feed_child_event
           works in all cases (unlike read/write/send/recv...).
         - try to detect signals around a fork faster (test program by
           Denis Bilenko).
+        - work around recent glibc versions that leak memory in realloc.
 
 4.11 Sat Feb  4 19:52:39 CET 2012
        - INCOMPATIBLE CHANGE: ev_timer_again now clears the pending status, as
diff --git a/ev.c b/ev.c
index 317dd8ef6fb74d56b30e484150d97c9ef76876f4..09adac977787197df975891115a1b956de452c77 100644 (file)
--- a/ev.c
+++ b/ev.c
@@ -1193,12 +1193,11 @@ ev_syserr (const char *msg)
 static void *
 ev_realloc_emul (void *ptr, long size) EV_THROW
 {
-#if __GLIBC__
-  return realloc (ptr, size);
-#else
   /* some systems, notably openbsd and darwin, fail to properly
    * implement realloc (x, 0) (as required by both ansi c-89 and
    * the single unix specification, so work around them here.
+   * recently, also (at least) fedora and debian started breaking it,
+   * despite documenting it otherwise.
    */
 
   if (size)
@@ -1206,7 +1205,6 @@ ev_realloc_emul (void *ptr, long size) EV_THROW
 
   free (ptr);
   return 0;
-#endif
 }
 
 static void *(*alloc)(void *ptr, long size) EV_THROW = ev_realloc_emul;