]> sjero.net Git - wget/commitdiff
[svn] Warn the user to increase SZ before aborting.
authorhniksic <devnull@localhost>
Mon, 11 Apr 2005 00:42:18 +0000 (17:42 -0700)
committerhniksic <devnull@localhost>
Mon, 11 Apr 2005 00:42:18 +0000 (17:42 -0700)
src/ChangeLog
src/xmalloc.c

index e066561031d8714fa25aa4d83ec19eced77e6dd8..127d5df5336a307af0ce87b5ac5051365220fc43 100644 (file)
@@ -1,3 +1,8 @@
+2005-04-11  Hrvoje Niksic  <hniksic@xemacs.org>
+
+       * xmalloc.c (register_ptr): Warn the user to increase SZ prior to
+       aborting.
+
 2005-04-11  Hrvoje Niksic  <hniksic@xemacs.org>
 
        * convert.c (convert_cleanup): Free converted_files.
index ab5ac81211cc7b5337240e4d8bdde587e77ab197..75112c6b2b1aed76f9652076b92124a7b2dc7f2c 100644 (file)
@@ -218,9 +218,8 @@ static int malloc_count, free_count;
 
 /* Home-grown hash table of mallocs: */
 
-#define SZ 100003              /* Prime number a little over 100,000.
-                                  Increase the table size if you need
-                                  to debug larger Wget runs.  */
+#define SZ 100003              /* Prime just over 100,000.  Increase
+                                  it to debug larger Wget runs.  */
 
 static struct {
   const void *ptr;
@@ -250,7 +249,11 @@ register_ptr (const void *ptr, const char *file, int line)
 {
   int i;
   if (malloc_count - free_count > SZ)
-    abort ();
+    {
+      fprintf (stderr, "Increase SZ to a larger value and recompile.\n");
+      fflush (stderr);
+      abort ();
+    }
 
   i = ptr_position (ptr);
   malloc_table[i].ptr = ptr;