Skip to content

Commit

Permalink
minor fix in gc-debug
Browse files Browse the repository at this point in the history
  • Loading branch information
Diogo Netto authored and Diogo Netto committed Oct 17, 2022
1 parent 8b42ac8 commit 881d1dc
Showing 1 changed file with 2 additions and 9 deletions.
11 changes: 2 additions & 9 deletions src/gc-debug.c
Original file line number Diff line number Diff line change
Expand Up @@ -198,7 +198,6 @@ static void restore(void)

static void gc_verify_track(jl_ptls_t ptls)
{
#ifdef DFS_MARK
do {
jl_gc_markqueue_t mq;
mq.current = mq.start = (ptls->mark_queue).start;
Expand All @@ -213,7 +212,7 @@ static void gc_verify_track(jl_ptls_t ptls)
gc_mark_finlist(&mq, &ptls2->finalizers, 0);
}
gc_mark_finlist(&mq, &finalizer_list_marked, 0);
_gc_mark_loop(ptls, &mq);
gc_mark_loop_(ptls, &mq);
if (lostval_parents.len == 0) {
jl_safe_printf("Could not find the missing link. We missed a toplevel root. This is odd.\n");
break;
Expand Down Expand Up @@ -243,12 +242,10 @@ static void gc_verify_track(jl_ptls_t ptls)
}
restore();
} while(lostval != NULL);
#endif
}

void gc_verify(jl_ptls_t ptls)
{
#ifdef DFS_MARK
jl_gc_markqueue_t mq;
mq.current = mq.start = (ptls->mark_queue).start;
mq.end = (ptls->mark_queue).end;
Expand All @@ -264,7 +261,7 @@ void gc_verify(jl_ptls_t ptls)
gc_mark_finlist(&mq, &ptls2->finalizers, 0);
}
gc_mark_finlist(&mq, &finalizer_list_marked, 0);
_gc_mark_loop(ptls, &mq);
gc_mark_loop_(ptls, &mq);
int clean_len = bits_save[GC_CLEAN].len;
for(int i = 0; i < clean_len + bits_save[GC_OLD].len; i++) {
jl_taggedvalue_t *v = (jl_taggedvalue_t*)bits_save[i >= clean_len ? GC_OLD : GC_CLEAN].items[i >= clean_len ? i - clean_len : i];
Expand All @@ -289,8 +286,6 @@ void gc_verify(jl_ptls_t ptls)
jl_gc_debug_critical_error();
abort();
#endif
}
#endif

#ifdef MEMFENCE
static uint8_t freelist_map[GC_PAGE_SZ / sizeof(void*) / 8];
Expand Down Expand Up @@ -1276,7 +1271,6 @@ int gc_slot_to_arrayidx(void *obj, void *_slot)
// `offset` will be added to `mq->current` for convenience in the debugger.
NOINLINE void gc_mark_loop_unwind(jl_ptls_t ptls, jl_gc_markqueue_t *mq, int offset)
{
#ifdef DFS_MARK
jl_jmp_buf *old_buf = jl_get_safe_restore();
jl_jmp_buf buf;
jl_set_safe_restore(&buf);
Expand All @@ -1295,7 +1289,6 @@ NOINLINE void gc_mark_loop_unwind(jl_ptls_t ptls, jl_gc_markqueue_t *mq, int off
jl_((void*)(jl_datatype_t *)(o->header & ~(uintptr_t)0xf));
}
jl_set_safe_restore(old_buf);
#endif
}

static int gc_logging_enabled = 0;
Expand Down

0 comments on commit 881d1dc

Please sign in to comment.