]> git.ipfire.org Git - thirdparty/binutils-gdb.git/blobdiff - gdb/common/refcounted-object.h
Use thread_info and inferior pointers more throughout
[thirdparty/binutils-gdb.git] / gdb / common / refcounted-object.h
index e9cdc042fd03dc4020e07bc8c8ca847eadeb9bcb..a3799d8de4dec85d70df778ee9570580d3333c75 100644 (file)
@@ -51,4 +51,20 @@ private:
   int m_refcount = 0;
 };
 
+/* A policy class to interface gdb::ref_ptr with a
+   refcounted_object.  */
+
+struct refcounted_object_ref_policy
+{
+  static void incref (refcounted_object *ptr)
+  {
+    ptr->incref ();
+  }
+
+  static void decref (refcounted_object *ptr)
+  {
+    ptr->decref ();
+  }
+};
+
 #endif /* REFCOUNTED_OBJECT_H */