1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

Add comments for new function

This commit is contained in:
Aaron Patterson 2021-09-10 15:01:19 -07:00 committed by Alan Wu
parent 25f8431d46
commit bf8557f487

View file

@ -1371,6 +1371,10 @@ rb_vm_setinstancevariable(const rb_iseq_t *iseq, VALUE obj, ID id, VALUE val, IV
vm_setinstancevariable(iseq, obj, id, val, ic);
}
/* Set the instance variable +val+ on object +obj+ at the +index+.
* This function only works with T_OBJECT objects, so make sure
* +obj+ is of type T_OBJECT before using this function.
*/
VALUE
rb_vm_set_ivar_idx(VALUE obj, uint32_t index, VALUE val)
{
@ -1385,8 +1389,8 @@ rb_vm_set_ivar_idx(VALUE obj, uint32_t index, VALUE val)
}
VALUE *ptr = ROBJECT_IVPTR(obj);
RB_OBJ_WRITE(obj, &ptr[index], val);
RB_DEBUG_COUNTER_INC(ivar_set_ic_hit);
return val; /* inline cache hit */
return val;
}
static VALUE