* gc.c: use gc_verify_internal_consistency() instead of

gc_check_before_marks_i() for check consistency
  on RGENGC_CHECK_MODE >= 2.



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@44231 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
ko1 2013-12-16 05:18:21 +00:00
Родитель 2a732947a6
Коммит c979a67bb4
2 изменённых файлов: 8 добавлений и 31 удалений

Просмотреть файл

@ -1,3 +1,9 @@
Mon Dec 16 14:14:22 2013 Koichi Sasada <ko1@atdot.net>
* gc.c: use gc_verify_internal_consistency() instead of
gc_check_before_marks_i() for check consistency
on RGENGC_CHECK_MODE >= 2.
Mon Dec 16 14:01:48 2013 NARUSE, Yui <naruse@ruby-lang.org>
* process.c (make_clock_result): add :second as a unit for

33
gc.c
Просмотреть файл

@ -4206,7 +4206,7 @@ gc_verify_internal_consistency(VALUE self)
return Qnil;
}
#if RGENGC_CHECK_MODE >= 2
#if RGENGC_CHECK_MODE >= 3
#define MAKE_ROOTSIG(obj) (((VALUE)(obj) << 1) | 0x01)
#define IS_ROOTSIG(obj) ((VALUE)(obj) & 0x01)
@ -4394,35 +4394,6 @@ allrefs_dump(rb_objspace_t *objspace)
}
#endif
static int
gc_check_before_marks_i(st_data_t k, st_data_t v, void *ptr)
{
VALUE obj = k;
struct reflist *refs = (struct reflist *)v;
rb_objspace_t *objspace = (rb_objspace_t *)ptr;
/* check WB sanity */
if (!RVALUE_OLD_P(obj)) {
int i;
for (i=0; i<refs->pos; i++) {
VALUE parent = refs->list[i];
if (!IS_ROOTSIG(parent) && RVALUE_OLD_P(parent)) {
/* parent is old */
if (!MARKED_IN_BITMAP(GET_HEAP_PAGE(parent)->rememberset_bits, parent) &&
!MARKED_IN_BITMAP(GET_HEAP_PAGE(obj)->rememberset_bits, obj)) {
fprintf(stderr, "gc_marks_check_i: WB miss %p (%s) -> %p (%s) ",
(void *)parent, obj_type_name(parent),
(void *)obj, obj_type_name(obj));
reflist_dump(refs);
fprintf(stderr, "\n");
objspace->rgengc.error_count++;
}
}
}
}
return ST_CONTINUE;
}
#if RGENGC_CHECK_MODE >= 3
static int
gc_check_after_marks_i(st_data_t k, st_data_t v, void *ptr)
@ -4496,7 +4467,7 @@ gc_marks(rb_objspace_t *objspace, int full_mark)
#if USE_RGENGC
#if RGENGC_CHECK_MODE >= 2
gc_marks_check(objspace, gc_check_before_marks_i, "before_marks");
gc_verify_internal_consistency(Qnil);
#endif
if (full_mark == TRUE) { /* major/full GC */
objspace->rgengc.remembered_shady_object_count = 0;