public inbox for gdb-cvs@sourceware.org
help / color / mirror / Atom feed
* [binutils-gdb] Add a noop deleter
@ 2019-05-08 22:09 Tom Tromey
0 siblings, 0 replies; only message in thread
From: Tom Tromey @ 2019-05-08 22:09 UTC (permalink / raw)
To: gdb-cvs
https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=31930bd34d15dd22c5ef47b46d8bc95a5ec34d0e
commit 31930bd34d15dd22c5ef47b46d8bc95a5ec34d0e
Author: Tom Tromey <tom@tromey.com>
Date: Wed May 1 15:28:18 2019 -0600
Add a noop deleter
This adds a no-op deleter, which is used in subsequent patches.
gdb/ChangeLog
2019-05-08 Tom Tromey <tom@tromey.com>
* common/gdb_unique_ptr.h (struct noop_deleter): New.
Diff:
---
gdb/ChangeLog | 4 ++++
gdb/common/gdb_unique_ptr.h | 7 +++++++
2 files changed, 11 insertions(+)
diff --git a/gdb/ChangeLog b/gdb/ChangeLog
index a8d727b..edda8c9 100644
--- a/gdb/ChangeLog
+++ b/gdb/ChangeLog
@@ -1,5 +1,9 @@
2019-05-08 Tom Tromey <tom@tromey.com>
+ * common/gdb_unique_ptr.h (struct noop_deleter): New.
+
+2019-05-08 Tom Tromey <tom@tromey.com>
+
* nto-tdep.c (nto_inferior_data_reg): Change type.
(nto_inferior_data): Update.
(nto_inferior_data_cleanup, nto_new_inferior_data)
diff --git a/gdb/common/gdb_unique_ptr.h b/gdb/common/gdb_unique_ptr.h
index 327e127..a4be2bb 100644
--- a/gdb/common/gdb_unique_ptr.h
+++ b/gdb/common/gdb_unique_ptr.h
@@ -47,6 +47,13 @@ struct xfree_deleter<T[]>
template<typename T> using unique_xmalloc_ptr
= std::unique_ptr<T, xfree_deleter<T>>;
+/* A no-op deleter. */
+template<typename T>
+struct noop_deleter
+{
+ void operator() (T *ptr) const { }
+};
+
} /* namespace gdb */
#endif /* COMMON_GDB_UNIQUE_PTR_H */
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2019-05-08 22:09 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-05-08 22:09 [binutils-gdb] Add a noop deleter Tom Tromey
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).