diff --git a/ChangeLog b/ChangeLog index 7ade41d42f..0b5fcd475e 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +Thu Mar 19 16:12:01 2015 Koichi Sasada + + * 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 * gc.c (rb_copy_wb_protected_attribute): need demote for old objects. diff --git a/gc.c b/gc.c index 8b1493fc5e..44373a4314 100644 --- a/gc.c +++ b/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); } } }