]> mj.ucw.cz Git - libucw.git/blobdiff - lib/realloc.c
Fixed thread safety of signal handling.
[libucw.git] / lib / realloc.c
index 536f61f9acce4714b53e9a43e6222b6e35ac67d0..6d6b0baf2304b933602f33db7e24cd2ff7a6b033 100644 (file)
@@ -1,5 +1,5 @@
 /*
 /*
- *     Sherlock Library -- Memory Re-allocation
+ *     UCW Library -- Memory Re-allocation
  *
  *     (c) 1997 Martin Mares <mj@ucw.cz>
  *
  *
  *     (c) 1997 Martin Mares <mj@ucw.cz>
  *
@@ -16,6 +16,7 @@
 void *
 xrealloc(void *old, uns size)
 {
 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);
   void *x = realloc(old, size);
   if (!x)
     die("Cannot reallocate %d bytes of memory", size);