From 31930bd34d15dd22c5ef47b46d8bc95a5ec34d0e Mon Sep 17 00:00:00 2001 From: Tom Tromey Date: Wed, 1 May 2019 15:28:18 -0600 Subject: [PATCH] Add a noop deleter This adds a no-op deleter, which is used in subsequent patches. gdb/ChangeLog 2019-05-08 Tom Tromey * common/gdb_unique_ptr.h (struct noop_deleter): New. --- gdb/ChangeLog | 4 ++++ gdb/common/gdb_unique_ptr.h | 7 +++++++ 2 files changed, 11 insertions(+) diff --git a/gdb/ChangeLog b/gdb/ChangeLog index a8d727b87b1..edda8c918e0 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,3 +1,7 @@ +2019-05-08 Tom Tromey + + * common/gdb_unique_ptr.h (struct noop_deleter): New. + 2019-05-08 Tom Tromey * nto-tdep.c (nto_inferior_data_reg): Change type. diff --git a/gdb/common/gdb_unique_ptr.h b/gdb/common/gdb_unique_ptr.h index 327e1279296..a4be2bb7963 100644 --- a/gdb/common/gdb_unique_ptr.h +++ b/gdb/common/gdb_unique_ptr.h @@ -47,6 +47,13 @@ struct xfree_deleter template using unique_xmalloc_ptr = std::unique_ptr>; +/* A no-op deleter. */ +template +struct noop_deleter +{ + void operator() (T *ptr) const { } +}; + } /* namespace gdb */ #endif /* COMMON_GDB_UNIQUE_PTR_H */ -- 2.30.2