mirror of
https://github.com/espressif/binutils-gdb.git
synced 2025-06-01 11:59:27 +08:00
Remove make_cleanup_free_so
make_cleanup_free_so is used in a single spot. This patch introduces a unique pointer wrapper for struct so_list, and changes this spot to use it. ChangeLog 2017-08-03 Tom Tromey <tom@tromey.com> * utils.h (make_cleanup_free_so): Remove. * utils.c (do_free_so, make_cleanup_free_so): Remove. * solist.h (struct so_deleter): New. (so_list_up): New typedef. * solib-svr4.c (svr4_read_so_list): Use so_list_up.
This commit is contained in:
12
gdb/solist.h
12
gdb/solist.h
@ -179,6 +179,18 @@ struct target_so_ops
|
||||
/* Free the memory associated with a (so_list *). */
|
||||
void free_so (struct so_list *so);
|
||||
|
||||
/* A deleter that calls free_so. */
|
||||
struct so_deleter
|
||||
{
|
||||
void operator() (struct so_list *so) const
|
||||
{
|
||||
free_so (so);
|
||||
}
|
||||
};
|
||||
|
||||
/* A unique pointer to a so_list. */
|
||||
typedef std::unique_ptr<so_list, so_deleter> so_list_up;
|
||||
|
||||
/* Return address of first so_list entry in master shared object list. */
|
||||
struct so_list *master_so_list (void);
|
||||
|
||||
|
Reference in New Issue
Block a user