1
0
mirror of https://github.com/moparisthebest/wget synced 2024-07-03 16:38:41 -04:00

[svn] Warn the user to increase SZ before aborting.

This commit is contained in:
hniksic 2005-04-10 17:42:18 -07:00
parent 96d5ceefe4
commit 4dc559af46
2 changed files with 12 additions and 4 deletions

View 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> 2005-04-11 Hrvoje Niksic <hniksic@xemacs.org>
* convert.c (convert_cleanup): Free converted_files. * convert.c (convert_cleanup): Free converted_files.

View File

@ -218,9 +218,8 @@ static int malloc_count, free_count;
/* Home-grown hash table of mallocs: */ /* Home-grown hash table of mallocs: */
#define SZ 100003 /* Prime number a little over 100,000. #define SZ 100003 /* Prime just over 100,000. Increase
Increase the table size if you need it to debug larger Wget runs. */
to debug larger Wget runs. */
static struct { static struct {
const void *ptr; const void *ptr;
@ -250,7 +249,11 @@ register_ptr (const void *ptr, const char *file, int line)
{ {
int i; int i;
if (malloc_count - free_count > SZ) if (malloc_count - free_count > SZ)
{
fprintf (stderr, "Increase SZ to a larger value and recompile.\n");
fflush (stderr);
abort (); abort ();
}
i = ptr_position (ptr); i = ptr_position (ptr);
malloc_table[i].ptr = ptr; malloc_table[i].ptr = ptr;