]> mj.ucw.cz Git - libucw.git/blobdiff - lib/realloc.c
Double oops.
[libucw.git] / lib / realloc.c
index 6829c71fb46b8588832c86bb75a45695bf3df6b4..c432887015be839f2a8513f09c27a32fc92527e3 100644 (file)
@@ -2,17 +2,25 @@
  *     Sherlock Library -- Memory Re-allocation
  *
  *     (c) 1997 Martin Mares <mj@ucw.cz>
+ *
+ *     This software may be freely distributed and used according to the terms
+ *     of the GNU Lesser General Public License.
  */
 
 #include "lib/lib.h"
 
 #include <stdlib.h>
 
+#ifndef DEBUG_DMALLOC
+
 void *
 xrealloc(void *old, uns size)
 {
+  /* We assume that realloc(NULL, x) works like malloc(x), which is true with the glibc. */
   void *x = realloc(old, size);
   if (!x)
     die("Cannot reallocate %d bytes of memory", size);
   return x;
 }
+
+#endif