]> mj.ucw.cz Git - libucw.git/blobdiff - lib/realloc.c
Fixed compilation rules for Perl modules to avoid unnecessary rebuilds.
[libucw.git] / lib / realloc.c
index 3ee75aa8c3caeb983259c43b1ff19bf785e60cf5..6d6b0baf2304b933602f33db7e24cd2ff7a6b033 100644 (file)
@@ -1,19 +1,26 @@
 /*
- *     Sherlock Library -- Memory Re-allocation
+ *     UCW Library -- Memory Re-allocation
  *
- *     (c) 1997 Martin Mares, <mj@atrey.karlin.mff.cuni.cz>
+ *     (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 <stdio.h>
+#include "lib/lib.h"
+
 #include <stdlib.h>
 
-#include "lib/lib.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