diff --git a/ChangeLog b/ChangeLog index 023307e362..82306bbf4b 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +Sun Jul 6 21:30:35 2014 Koichi Sasada + + * gc.c (is_dying_object): fix missed condition. + + * gc.c (is_live_object): move frequent path first. + Sun Jul 6 21:00:11 2014 Koichi Sasada * gc.c: rename is_dead_object() to is_dying_object(). diff --git a/gc.c b/gc.c index cb14033717..2d0ba1d61d 100644 --- a/gc.c +++ b/gc.c @@ -2333,7 +2333,7 @@ static inline int is_dying_object(rb_objspace_t *objspace, VALUE ptr) { if (!is_lazy_sweeping(heap_eden) || - !is_swept_object(objspace, ptr) || + is_swept_object(objspace, ptr) || MARKED_IN_BITMAP(GET_HEAP_MARK_BITS(ptr), ptr)) { return FALSE; @@ -2352,11 +2352,11 @@ is_live_object(rb_objspace_t *objspace, VALUE ptr) return FALSE; } - if (is_dying_object(objspace, ptr)) { - return FALSE; + if (!is_dying_object(objspace, ptr)) { + return TRUE; } else { - return TRUE; + return FALSE; } }