mirror of
https://github.com/espressif/binutils-gdb.git
synced 2025-06-17 07:53:51 +08:00
Turn value_incref and value_decref into methods
This changes value_incref and value_decref to be methods of value. Much of this patch was written by script. Approved-By: Simon Marchi <simon.marchi@efficios.com>
This commit is contained in:
@ -110,7 +110,7 @@ allocate_lval_closure (int *indices, int n, struct value *val)
|
||||
c->n = n;
|
||||
c->indices = XCNEWVEC (int, n);
|
||||
memcpy (c->indices, indices, n * sizeof (int));
|
||||
value_incref (val); /* Increment the reference counter of the value. */
|
||||
val->incref (); /* Increment the reference counter of the value. */
|
||||
c->val = val;
|
||||
|
||||
return c;
|
||||
@ -242,7 +242,7 @@ lval_func_free_closure (struct value *v)
|
||||
|
||||
if (c->refc == 0)
|
||||
{
|
||||
value_decref (c->val); /* Decrement the reference counter of the value. */
|
||||
c->val->decref (); /* Decrement the reference counter of the value. */
|
||||
xfree (c->indices);
|
||||
xfree (c);
|
||||
}
|
||||
|
Reference in New Issue
Block a user