+/* Decref a target and close if, if there are no references left. */
+extern void decref_target (target_ops *t);
+
+/* A policy class to interface gdb::ref_ptr with target_ops. */
+
+struct target_ops_ref_policy
+{
+ static void incref (target_ops *t)
+ {
+ t->incref ();
+ }
+
+ static void decref (target_ops *t)
+ {
+ decref_target (t);
+ }
+};
+
+/* A gdb::ref_ptr pointer to a target_ops. */
+typedef gdb::ref_ptr<target_ops, target_ops_ref_policy> target_ops_ref;
+