This is the mail archive of the gdb-cvs@sourceware.org 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]
Other format: [Raw text]

[binutils-gdb] Remove free_current_contents


https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=0ccf4211fdec30fab46a5552ecfbe8e7ca98d50f

commit 0ccf4211fdec30fab46a5552ecfbe8e7ca98d50f
Author: Tom Tromey <tom@tromey.com>
Date:   Thu Jan 24 09:58:29 2019 -0700

    Remove free_current_contents
    
    free_current_contents is no longer used, so this patch removes it.
    
    2019-03-06  Tom Tromey  <tom@tromey.com>
    
    	* utils.h (free_current_contents): Don't declare.
    	* utils.c (free_current_contents): Remove.

Diff:
---
 gdb/ChangeLog |  5 +++++
 gdb/utils.c   | 29 -----------------------------
 gdb/utils.h   |  2 --
 3 files changed, 5 insertions(+), 31 deletions(-)

diff --git a/gdb/ChangeLog b/gdb/ChangeLog
index a311b82..066761d 100644
--- a/gdb/ChangeLog
+++ b/gdb/ChangeLog
@@ -1,5 +1,10 @@
 2019-03-06  Tom Tromey  <tom@tromey.com>
 
+	* utils.h (free_current_contents): Don't declare.
+	* utils.c (free_current_contents): Remove.
+
+2019-03-06  Tom Tromey  <tom@tromey.com>
+
 	* top.c (quit_force): Update.
 	* main.c (captured_command_loop): Update.
 	* common/new-op.c (operator new): Update.
diff --git a/gdb/utils.c b/gdb/utils.c
index 6520f1d..258614a 100644
--- a/gdb/utils.c
+++ b/gdb/utils.c
@@ -127,35 +127,6 @@ show_pagination_enabled (struct ui_file *file, int from_tty,
 }
 
 
-/* Cleanup utilities.
-
-   These are not defined in cleanups.c (nor declared in cleanups.h)
-   because while they use the "cleanup API" they are not part of the
-   "cleanup API".  */
-
-/* This function is useful for cleanups.
-   Do
-
-   foo = xmalloc (...);
-   old_chain = make_cleanup (free_current_contents, &foo);
-
-   to arrange to free the object thus allocated.  */
-
-void
-free_current_contents (void *ptr)
-{
-  void **location = (void **) ptr;
-
-  if (location == NULL)
-    internal_error (__FILE__, __LINE__,
-		    _("free_current_contents: NULL pointer"));
-  if (*location != NULL)
-    {
-      xfree (*location);
-      *location = NULL;
-    }
-}
-
 
 
 /* Print a warning message.  The first argument STRING is the warning
diff --git a/gdb/utils.h b/gdb/utils.h
index 9dbd638..f0cb48e 100644
--- a/gdb/utils.h
+++ b/gdb/utils.h
@@ -260,8 +260,6 @@ struct htab_deleter
 /* A unique_ptr wrapper for htab_t.  */
 typedef std::unique_ptr<htab, htab_deleter> htab_up;
 
-extern void free_current_contents (void *);
-
 extern void init_page_info (void);
 
 /* Temporarily set BATCH_FLAG and the associated unlimited terminal size.


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