This is the mail archive of the
gdb-patches@sources.redhat.com
mailing list for the GDB project.
[PATCH RFC,RFA] free() -> xfree(), part 1
- To: gdb-patches at sourceware dot cygnus dot com
- Subject: [PATCH RFC,RFA] free() -> xfree(), part 1
- From: Kevin Buettner <kevinb at cygnus dot com>
- Date: Thu, 30 Nov 2000 02:17:46 -0700
Here are the manual changes needed for the free() -> xfree()
substitutions.
* defs.h, utils.c (xfree): New function.
Index: defs.h
===================================================================
RCS file: /cvs/src/src/gdb/defs.h,v
retrieving revision 1.32
diff -u -p -r1.32 defs.h
--- defs.h 2000/11/20 02:06:18 1.32
+++ defs.h 2000/11/30 05:22:30
@@ -367,6 +367,8 @@ extern void free_current_contents (void
extern void null_cleanup (void *);
+extern void xfree (void *);
+
extern int myread (int, char *, int);
extern int query (char *, ...) ATTR_FORMAT (printf, 1, 2);
Index: utils.c
===================================================================
RCS file: /cvs/src/src/gdb/utils.c,v
retrieving revision 1.23
diff -u -p -r1.23 utils.c
--- utils.c 2000/11/20 02:06:19 1.23
+++ utils.c 2000/11/30 05:24:32
@@ -1077,6 +1077,16 @@ xrealloc (PTR ptr, size_t size)
{
return (xmrealloc ((PTR) NULL, ptr, size));
}
+
+/* Free up space allocated by one of xmalloc(), xcalloc(), or
+ xrealloc(). */
+
+void
+xfree (void *ptr)
+{
+ if (ptr != NULL)
+ free (ptr);
+}
/* Like asprintf/vasprintf but get an internal_error if the call