[svn] Made xfree alias to free if memory debugging is not used.

From <sxsd7ezd7p2.fsf@florida.arsdigita.de>.
This commit is contained in:
hniksic 2000-12-10 18:17:44 -08:00
parent d5cd691b12
commit bdea0b3bf6
3 changed files with 10 additions and 10 deletions

View File

@ -1,3 +1,10 @@
2000-12-11 Hrvoje Niksic <hniksic@arsdigita.com>
* utils.c (xfree_real): Removed.
(xfree_debug): Just call free().
* wget.h (xfree): Make it an alias for free.
2000-12-11 Hrvoje Niksic <hniksic@arsdigita.com>
* http.c (http_loop): Furthermore, touch output_document only if

View File

@ -102,9 +102,9 @@ memfatal (const char *what)
If memory debugging is not turned on, wget.h defines these:
#define xmalloc xmalloc_real
#define xfree xfree_real
#define xrealloc xrealloc_real
#define xstrdup xstrdup_real
#define xfree free
In case of memory debugging, the definitions are a bit more
complex, because we want to provide more information, *and* we want
@ -134,12 +134,6 @@ xmalloc_real (size_t size)
return ptr;
}
STATIC_IF_DEBUG void
xfree_real (void *ptr)
{
free (ptr);
}
STATIC_IF_DEBUG void *
xrealloc_real (void *ptr, size_t newsize)
{
@ -279,7 +273,7 @@ xfree_debug (void *ptr, const char *source_file, int source_line)
assert (ptr != NULL);
++free_count;
unregister_ptr (ptr);
xfree_real (ptr);
free (ptr);
}
void *

View File

@ -101,12 +101,11 @@ void logputs PARAMS ((enum log_options, const char *));
#ifndef DEBUG_MALLOC
#define xmalloc xmalloc_real
#define xfree xfree_real
#define xrealloc xrealloc_real
#define xstrdup xstrdup_real
#define xfree free
void *xmalloc_real PARAMS ((size_t));
void xfree_real PARAMS ((void *));
void *xrealloc_real PARAMS ((void *, size_t));
char *xstrdup_real PARAMS ((const char *));