Lines 577-585
scm_i_init_thread_for_guile (SCM_STACKIT
Link Here
|
577 |
/* This thread is already guilified but not in guile mode, just |
577 |
/* This thread is already guilified but not in guile mode, just |
578 |
resume it. |
578 |
resume it. |
579 |
|
579 |
|
580 |
XXX - base might be lower than when this thread was first |
580 |
A user call to scm_with_guile() will lead us to here. This |
581 |
guilified. |
581 |
could happen anywhere on the stack, and in particular, the |
|
|
582 |
stack can be *much* shorter than what it was when this thread |
583 |
was first guilified. This will typically happen in |
584 |
on_thread_exit(), where the stack is *always* shorter than |
585 |
when the thread was first guilified. If the GC happens to |
586 |
get triggered due to some other thread, we'd end up with |
587 |
t->top "upside-down" w.r.t. t->base, which will result in |
588 |
chaos in scm_threads_mark_stacks() when top-base=2^32 or 2^64. |
589 |
Thus, reset the base, if needed. |
582 |
*/ |
590 |
*/ |
|
|
591 |
#if SCM_STACK_GROWS_UP |
592 |
if (base < t->base) |
593 |
t->base = base; |
594 |
#else |
595 |
if (base > t->base) |
596 |
t->base = base; |
597 |
#endif |
583 |
scm_enter_guile ((scm_t_guile_ticket) t); |
598 |
scm_enter_guile ((scm_t_guile_ticket) t); |
584 |
return 1; |
599 |
return 1; |
585 |
} |
600 |
} |