From 81b8eb809e1fd6ad16bbeda4a365b8e7a81a441c Mon Sep 17 00:00:00 2001 From: Andrew Cagney Date: Tue, 20 Mar 2001 00:28:23 +0000 Subject: [PATCH] Move free() decl to utils.c. --- gdb/ChangeLog | 7 +++++++ gdb/config/pa/xm-hppah.h | 2 -- gdb/defs.h | 4 ---- gdb/utils.c | 8 +++++++- 4 files changed, 14 insertions(+), 7 deletions(-) diff --git a/gdb/ChangeLog b/gdb/ChangeLog index 37ed00207e..8382df8403 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,3 +1,10 @@ +2001-03-19 Andrew Cagney + + * defs.h (free): Move declaration from here. + * utils.c (free): To here. + (xfree): Document as the only call to free(). + * config/pa/xm-hppah.h (free): Delete declaration. + 2001-03-19 Kevin Buettner * config/ia64/linux.mh (NATDEPFILES): Add proc-service.o to diff --git a/gdb/config/pa/xm-hppah.h b/gdb/config/pa/xm-hppah.h index a55c764309..f77493ab8b 100644 --- a/gdb/config/pa/xm-hppah.h +++ b/gdb/config/pa/xm-hppah.h @@ -44,5 +44,3 @@ extern void *malloc (size_t); extern void *realloc (void *, size_t); - -extern void free (void *); diff --git a/gdb/defs.h b/gdb/defs.h index 66c3e78419..939a8cc6de 100644 --- a/gdb/defs.h +++ b/gdb/defs.h @@ -955,10 +955,6 @@ extern PTR malloc (); extern PTR realloc (); #endif -#ifdef NEED_DECLARATION_FREE -extern void free (); -#endif - #endif /* MALLOC_INCOMPATIBLE */ /* Various possibilities for alloca. */ diff --git a/gdb/utils.c b/gdb/utils.c index b81e3fd4c9..3aac2db362 100644 --- a/gdb/utils.c +++ b/gdb/utils.c @@ -56,6 +56,12 @@ #include +#ifndef MALLOC_INCOMPATIBLE +#ifdef NEED_DECLARATION_FREE +extern void free (); +#endif +#endif + #undef XMALLOC #define XMALLOC(TYPE) ((TYPE*) xmalloc (sizeof (TYPE))) @@ -1110,7 +1116,7 @@ void xfree (void *ptr) { if (ptr != NULL) - free (ptr); + free (ptr); /* NOTE: GDB's only call to free() */ }