mirror of
https://github.com/espressif/binutils-gdb.git
synced 2025-08-03 04:01:22 +08:00
* utils.c (do_obstack_free): New function.
(make_cleanup_obstack_free): Likewise. * defs.h (make_cleanup_obstack_free): Declare.
This commit is contained in:
17
gdb/utils.c
17
gdb/utils.c
@ -271,6 +271,23 @@ make_cleanup_fclose (FILE *file)
|
||||
return make_cleanup (do_fclose_cleanup, file);
|
||||
}
|
||||
|
||||
/* Helper function which does the work for make_cleanup_obstack_free. */
|
||||
|
||||
static void
|
||||
do_obstack_free (void *arg)
|
||||
{
|
||||
struct obstack *ob = arg;
|
||||
obstack_free (ob, NULL);
|
||||
}
|
||||
|
||||
/* Return a new cleanup that frees OBSTACK. */
|
||||
|
||||
struct cleanup *
|
||||
make_cleanup_obstack_free (struct obstack *obstack)
|
||||
{
|
||||
return make_cleanup (do_obstack_free, obstack);
|
||||
}
|
||||
|
||||
static void
|
||||
do_ui_file_delete (void *arg)
|
||||
{
|
||||
|
Reference in New Issue
Block a user