This is the mail archive of the gdb-patches@sources.redhat.com mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

[patch] free() free zone


Just FYI,

I've checked in the attatched.

	Andrew
2001-03-19  Andrew Cagney  <ac131313@redhat.com>

	* 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.

Index: defs.h
===================================================================
RCS file: /cvs/src/src/gdb/defs.h,v
retrieving revision 1.43
diff -p -r1.43 defs.h
*** defs.h	2001/03/14 16:42:29	1.43
--- defs.h	2001/03/20 00:18:56
*************** extern PTR malloc ();
*** 955,964 ****
  extern PTR realloc ();
  #endif
  
- #ifdef NEED_DECLARATION_FREE
- extern void free ();
- #endif
- 
  #endif /* MALLOC_INCOMPATIBLE */
  
  /* Various possibilities for alloca.  */
--- 955,960 ----
Index: utils.c
===================================================================
RCS file: /cvs/src/src/gdb/utils.c,v
retrieving revision 1.35
diff -p -r1.35 utils.c
*** utils.c	2001/03/10 01:22:11	1.35
--- utils.c	2001/03/20 00:19:10
***************
*** 56,61 ****
--- 56,67 ----
  
  #include <readline/readline.h>
  
+ #ifndef MALLOC_INCOMPATIBLE
+ #ifdef NEED_DECLARATION_FREE
+ extern void free ();
+ #endif
+ #endif
+ 
  #undef XMALLOC
  #define XMALLOC(TYPE) ((TYPE*) xmalloc (sizeof (TYPE)))
  
*************** void
*** 1110,1116 ****
  xfree (void *ptr)
  {
    if (ptr != NULL)
!     free (ptr);
  }
  
  
--- 1116,1122 ----
  xfree (void *ptr)
  {
    if (ptr != NULL)
!     free (ptr); /* NOTE: GDB's only call to free() */
  }
  
  
Index: config/pa/xm-hppah.h
===================================================================
RCS file: /cvs/src/src/gdb/config/pa/xm-hppah.h,v
retrieving revision 1.3
diff -p -r1.3 xm-hppah.h
*** xm-hppah.h	2001/03/06 08:21:34	1.3
--- xm-hppah.h	2001/03/20 00:19:10
***************
*** 44,48 ****
  extern void *malloc (size_t);
  
  extern void *realloc (void *, size_t);
- 
- extern void free (void *);
--- 44,46 ----

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]