aboutsummaryrefslogtreecommitdiff
path: root/gdb/value.h
diff options
context:
space:
mode:
Diffstat (limited to 'gdb/value.h')
-rw-r--r--gdb/value.h15
1 files changed, 15 insertions, 0 deletions
diff --git a/gdb/value.h b/gdb/value.h
index 6dee80a..bc97ec0 100644
--- a/gdb/value.h
+++ b/gdb/value.h
@@ -1018,6 +1018,21 @@ extern void value_incref (struct value *val);
extern void value_free (struct value *val);
+/* A free policy class to interface std::unique_ptr with
+ value_free. */
+
+struct value_deleter
+{
+ void operator() (struct value *value) const
+ {
+ value_free (value);
+ }
+};
+
+/* A unique pointer to a struct value. */
+
+typedef std::unique_ptr<struct value, value_deleter> gdb_value_up;
+
extern void free_all_values (void);
extern void free_value_chain (struct value *v);