diff options
Diffstat (limited to 'gdb')
-rw-r--r-- | gdb/ChangeLog | 4 | ||||
-rw-r--r-- | gdb/common/gdb_unique_ptr.h | 7 |
2 files changed, 11 insertions, 0 deletions
diff --git a/gdb/ChangeLog b/gdb/ChangeLog index 9918af1..f670f99 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,3 +1,7 @@ +2017-08-10 Pedro Alves <palves@redhat.com> + + * common/gdb_unique_ptr.h (xfree_deleter<T[]>): Define. + 2017-08-09 John Baldwin <jhb@FreeBSD.org> * fbsd-nat.c (struct fbsd_fork_info): Remove. diff --git a/gdb/common/gdb_unique_ptr.h b/gdb/common/gdb_unique_ptr.h index 4faadaf..34c993c 100644 --- a/gdb/common/gdb_unique_ptr.h +++ b/gdb/common/gdb_unique_ptr.h @@ -34,6 +34,13 @@ struct xfree_deleter void operator() (T *ptr) const { xfree (ptr); } }; +/* Same, for arrays. */ +template <typename T> +struct xfree_deleter<T[]> +{ + void operator() (T *ptr) const { xfree (ptr); } +}; + /* Import the standard unique_ptr to our namespace with a custom deleter. */ |