refactor constify most of rb_method_entry_t

Now that we have eliminated most destructive operations over the
rb_method_entry_t / rb_callable_method_entry_t, let's make them
mostly immutabe and mark them const.

One exception is rb_export_method(), which destructively modifies
visibilities of method entries.  I have left that operation as is
because I suspect that destructiveness is the nature of that
function.
This commit is contained in:
卜部昌平 2019-09-26 10:22:01 +09:00
parent 6c6a25feca
commit dd883de5ba
Notes: git 2019-09-30 10:27:04 +09:00
9 changed files with 88 additions and 109 deletions

View file

@ -123,7 +123,7 @@ method_coverage_i(void *vstart, void *vend, size_t stride, void *data)
for (v = (VALUE)vstart; v != (VALUE)vend; v += stride) {
if (RB_TYPE_P(v, T_IMEMO) && imemo_type(v) == imemo_ment) {
const rb_method_entry_t *me = (rb_method_entry_t *) v;
const rb_method_entry_t *me = (const rb_method_entry_t *) v;
VALUE path, first_lineno, first_column, last_lineno, last_column;
VALUE data[5], ncoverage, methods;
VALUE methods_id = ID2SYM(rb_intern("methods"));