set cont_key mark before capturing

svn: r2158
This commit is contained in:
Matthew Flatt 2006-02-07 17:30:41 +00:00
parent 446e0becb8
commit f0ecc49802

View File

@ -2956,7 +2956,7 @@ static MZ_MARK_STACK_TYPE find_shareable_marks(int for_recycle)
if (seg[pos].pos < MZ_CONT_MARK_POS) if (seg[pos].pos < MZ_CONT_MARK_POS)
break; break;
if (SAME_OBJ(seg[pos].key, cont_key) if (SAME_OBJ(seg[pos].key, cont_key)
|| (for_recycle && SAME_OBJ(seg[pos].key, scheme_stack_dump_key))) || (0 && for_recycle && SAME_OBJ(seg[pos].key, scheme_stack_dump_key)))
delta++; delta++;
else else
delta = 0; delta = 0;
@ -3057,6 +3057,9 @@ internal_call_cc (int argc, Scheme_Object *argv[])
} }
scheme_cont_capture_count++; scheme_cont_capture_count++;
/* Set cont_key mark before capturing marks: */
scheme_set_cont_mark(cont_key, (Scheme_Object *)cont);
if (p->cc_ok == thread_init_cc_ok) { if (p->cc_ok == thread_init_cc_ok) {
/* This continuation can be used by other threads, /* This continuation can be used by other threads,
so we need to track ownership of the runstack */ so we need to track ownership of the runstack */
@ -3106,8 +3109,6 @@ internal_call_cc (int argc, Scheme_Object *argv[])
scheme_flatten_config(scheme_current_config()); scheme_flatten_config(scheme_current_config());
scheme_set_cont_mark(cont_key, (Scheme_Object *)cont);
if (scheme_setjmpup_relative(&cont->buf, cont, p->next ? p->stack_start : p->o_start, sub_cont)) { if (scheme_setjmpup_relative(&cont->buf, cont, p->next ? p->stack_start : p->o_start, sub_cont)) {
/* We arrive here when the continuation is applied */ /* We arrive here when the continuation is applied */
MZ_MARK_STACK_TYPE copied_cms = 0; MZ_MARK_STACK_TYPE copied_cms = 0;