This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
[PATCH 12/20] Remove free_current_contents
- From: Tom Tromey <tom at tromey dot com>
- To: gdb-patches at sourceware dot org
- Cc: Tom Tromey <tom at tromey dot com>
- Date: Wed, 13 Feb 2019 14:29:19 -0700
- Subject: [PATCH 12/20] Remove free_current_contents
- References: <20190213212927.9474-1-tom@tromey.com>
free_current_contents is no longer used, so this patch removes it.
gdb/ChangeLog
2019-02-13 Tom Tromey <tom@tromey.com>
* utils.h (free_current_contents): Don't declare.
* utils.c (free_current_contents): Remove.
---
gdb/ChangeLog | 5 +++++
gdb/utils.c | 29 -----------------------------
gdb/utils.h | 2 --
3 files changed, 5 insertions(+), 31 deletions(-)
diff --git a/gdb/utils.c b/gdb/utils.c
index 6fb5736abb5..272fe268fef 100644
--- a/gdb/utils.c
+++ b/gdb/utils.c
@@ -126,35 +126,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 896feb973c9..30cf02f16c4 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.
--
2.17.2