mirror of
https://github.com/mruby/mruby
synced 2026-06-08 16:11:16 +00:00
Shared empty iv_tbl of module
This will be a partial merge of #5317 with the following changes. - Remove `iclass->iv_c` since `iclass->iv_c` is equivalent to `iclass->c`. - `class_iv_ptr()` returns a single pointer instead of a double pointer.
This commit is contained in:
@@ -1401,7 +1401,6 @@ include_class_new(mrb_state *mrb, struct RClass *m, struct RClass *super)
|
||||
m = m->c;
|
||||
}
|
||||
MRB_CLASS_ORIGIN(m);
|
||||
ic->iv = m->iv;
|
||||
ic->mt = m->mt;
|
||||
ic->super = super;
|
||||
if (m->tt == MRB_TT_ICLASS) {
|
||||
@@ -1526,7 +1525,6 @@ mrb_prepend_module(mrb_state *mrb, struct RClass *c, struct RClass *m)
|
||||
c->super = origin;
|
||||
origin->mt = c->mt;
|
||||
c->mt = NULL;
|
||||
origin->iv = c->iv;
|
||||
mrb_field_write_barrier(mrb, (struct RBasic*)c, (struct RBasic*)origin);
|
||||
c->flags |= MRB_FL_CLASS_IS_PREPENDED;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user