Remove free_current_contents
authorTom Tromey <tom@tromey.com>
Thu, 24 Jan 2019 16:58:29 +0000 (09:58 -0700)
committerTom Tromey <tom@tromey.com>
Wed, 6 Mar 2019 23:04:31 +0000 (16:04 -0700)
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.

gdb/ChangeLog
gdb/utils.c
gdb/utils.h

index a311b8290e40feb842771e6a459a12b06b0c7c8a..066761d76d05e3218e3f5020999d002702105ef9 100644 (file)
@@ -1,3 +1,8 @@
+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.
index 6520f1db2faeb4baa31297463d3454d39558ee9c..258614ac761ba4c404b2493d56189a09bb848571 100644 (file)
@@ -127,35 +127,6 @@ show_pagination_enabled (struct ui_file *file, int from_tty,
 }
 
 \f
-/* 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;
-    }
-}
-\f
 
 
 /* Print a warning message.  The first argument STRING is the warning
index 9dbd6386c68f3ccb51e3339b9a1e0ca4bc104aca..f0cb48e7a552e54711803516cb066fa7be675d38 100644 (file)
@@ -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.
This page took 0.077547 seconds and 4 git commands to generate.