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

[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> 2000-12-11 Hrvoje Niksic <hniksic@arsdigita.com>
* http.c (http_loop): Furthermore, touch output_document only if * 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: If memory debugging is not turned on, wget.h defines these:
#define xmalloc xmalloc_real #define xmalloc xmalloc_real
#define xfree xfree_real
#define xrealloc xrealloc_real #define xrealloc xrealloc_real
#define xstrdup xstrdup_real #define xstrdup xstrdup_real
#define xfree free
In case of memory debugging, the definitions are a bit more In case of memory debugging, the definitions are a bit more
complex, because we want to provide more information, *and* we want complex, because we want to provide more information, *and* we want
@ -134,12 +134,6 @@ xmalloc_real (size_t size)
return ptr; return ptr;
} }
STATIC_IF_DEBUG void
xfree_real (void *ptr)
{
free (ptr);
}
STATIC_IF_DEBUG void * STATIC_IF_DEBUG void *
xrealloc_real (void *ptr, size_t newsize) 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); assert (ptr != NULL);
++free_count; ++free_count;
unregister_ptr (ptr); unregister_ptr (ptr);
xfree_real (ptr); free (ptr);
} }
void * void *

View File

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