aboutsummaryrefslogtreecommitdiff
path: root/gdb/value.c
diff options
context:
space:
mode:
Diffstat (limited to 'gdb/value.c')
-rw-r--r--gdb/value.c10
1 files changed, 4 insertions, 6 deletions
diff --git a/gdb/value.c b/gdb/value.c
index 12aa2b8..eefaaaa 100644
--- a/gdb/value.c
+++ b/gdb/value.c
@@ -1133,7 +1133,7 @@ value_parent (const struct value *value)
void
set_value_parent (struct value *value, struct value *parent)
{
- value->parent = value_ref_ptr (value_incref (parent));
+ value->parent = value_ref_ptr::new_reference (parent);
}
gdb_byte *
@@ -1572,14 +1572,12 @@ value_mark (void)
return all_values.back ().get ();
}
-/* Take a reference to VAL. VAL will not be deallocated until all
- references are released. */
+/* See value.h. */
-struct value *
+void
value_incref (struct value *val)
{
val->reference_count++;
- return val;
}
/* Release a reference to VAL, which was acquired with value_incref.
@@ -1635,7 +1633,7 @@ release_value (struct value *val)
/* We must always return an owned reference. Normally this happens
because we transfer the reference from the value chain, but in
this case the value was not on the chain. */
- return value_ref_ptr (value_incref (val));
+ return value_ref_ptr::new_reference (val);
}
/* See value.h. */