зеркало из https://github.com/github/ruby.git
Implement Write Barriers on Enumerator::Generator
This commit is contained in:
Родитель
d7165d88ec
Коммит
2dadd17c78
|
@ -1434,7 +1434,7 @@ static const rb_data_type_t generator_data_type = {
|
|||
NULL,
|
||||
generator_compact,
|
||||
},
|
||||
0, 0, RUBY_TYPED_FREE_IMMEDIATELY | RUBY_TYPED_EMBEDDABLE
|
||||
0, 0, RUBY_TYPED_FREE_IMMEDIATELY | RUBY_TYPED_WB_PROTECTED | RUBY_TYPED_EMBEDDABLE
|
||||
};
|
||||
|
||||
static struct generator *
|
||||
|
@ -1474,7 +1474,7 @@ generator_init(VALUE obj, VALUE proc)
|
|||
rb_raise(rb_eArgError, "unallocated generator");
|
||||
}
|
||||
|
||||
ptr->proc = proc;
|
||||
RB_OBJ_WRITE(obj, &ptr->proc, proc);
|
||||
|
||||
return obj;
|
||||
}
|
||||
|
@ -1522,7 +1522,7 @@ generator_init_copy(VALUE obj, VALUE orig)
|
|||
rb_raise(rb_eArgError, "unallocated generator");
|
||||
}
|
||||
|
||||
ptr1->proc = ptr0->proc;
|
||||
RB_OBJ_WRITE(obj, &ptr1->proc, ptr0->proc);
|
||||
|
||||
return obj;
|
||||
}
|
||||
|
@ -1689,7 +1689,7 @@ lazy_generator_init(VALUE enumerator, VALUE procs)
|
|||
lazy_init_block, rb_ary_new3(2, obj, procs));
|
||||
|
||||
gen_ptr = generator_ptr(generator);
|
||||
gen_ptr->obj = obj;
|
||||
RB_OBJ_WRITE(generator, &gen_ptr->obj, obj);
|
||||
|
||||
return generator;
|
||||
}
|
||||
|
|
Загрузка…
Ссылка в новой задаче