зеркало из https://github.com/github/ruby.git
* gc.c (newobj_of): fix RGENGC_OLD_NEWOBJ_CHECK logics.
* skip on incremental marking because not sure what happen :p * rb_gc_writebarrier_remember() is enough to mark children. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@50024 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
Родитель
38cfec906d
Коммит
f537854ff3
|
@ -1,3 +1,9 @@
|
|||
Thu Mar 19 16:12:01 2015 Koichi Sasada <ko1@atdot.net>
|
||||
|
||||
* gc.c (newobj_of): fix RGENGC_OLD_NEWOBJ_CHECK logics.
|
||||
* skip on incremental marking because not sure what happen :p
|
||||
* rb_gc_writebarrier_remember() is enough to mark children.
|
||||
|
||||
Thu Mar 19 16:08:42 2015 Koichi Sasada <ko1@atdot.net>
|
||||
|
||||
* gc.c (rb_copy_wb_protected_attribute): need demote for old objects.
|
||||
|
|
8
gc.c
8
gc.c
|
@ -1748,7 +1748,8 @@ newobj_of(VALUE klass, VALUE flags, VALUE v1, VALUE v2, VALUE v3)
|
|||
{
|
||||
static int newobj_cnt = RGENGC_OLD_NEWOBJ_CHECK;
|
||||
|
||||
if (flags & FL_WB_PROTECTED && /* do not promote WB unprotected objects */
|
||||
if (!is_incremental_marking(objspace) &&
|
||||
flags & FL_WB_PROTECTED && /* do not promote WB unprotected objects */
|
||||
! RB_TYPE_P(obj, T_ARRAY)) { /* array.c assumes that allocated objects are new */
|
||||
if (--newobj_cnt == 0) {
|
||||
newobj_cnt = RGENGC_OLD_NEWOBJ_CHECK;
|
||||
|
@ -1756,10 +1757,7 @@ newobj_of(VALUE klass, VALUE flags, VALUE v1, VALUE v2, VALUE v3)
|
|||
gc_mark_set(objspace, obj);
|
||||
RVALUE_AGE_SET_OLD(objspace, obj);
|
||||
|
||||
if (is_pointer_to_heap(objspace, (void *)klass)) RB_OBJ_WRITTEN(obj, Qundef, klass);
|
||||
if (is_pointer_to_heap(objspace, (void *)v1)) RB_OBJ_WRITTEN(obj, Qundef, v1);
|
||||
if (is_pointer_to_heap(objspace, (void *)v2)) RB_OBJ_WRITTEN(obj, Qundef, v2);
|
||||
if (is_pointer_to_heap(objspace, (void *)v3)) RB_OBJ_WRITTEN(obj, Qundef, v3);
|
||||
rb_gc_writebarrier_remember(obj);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Загрузка…
Ссылка в новой задаче