mirror of
https://git.savannah.gnu.org/git/guile.git
synced 2025-06-17 17:20:29 +02:00
More precise stack marking.
* libguile/vm.c (scm_i_vm_mark_stack): Mark the stack more precisely.
This commit is contained in:
parent
5f18bc8450
commit
1cdf9b788e
1 changed files with 13 additions and 5 deletions
|
@ -777,12 +777,20 @@ struct GC_ms_entry *
|
|||
scm_i_vm_mark_stack (struct scm_vm *vp, struct GC_ms_entry *mark_stack_ptr,
|
||||
struct GC_ms_entry *mark_stack_limit)
|
||||
{
|
||||
GC_word *word;
|
||||
SCM *sp, *fp;
|
||||
|
||||
for (word = (GC_word *) vp->stack_base; word <= (GC_word *) vp->sp; word++)
|
||||
mark_stack_ptr = GC_MARK_AND_PUSH ((* (GC_word **) word),
|
||||
mark_stack_ptr, mark_stack_limit,
|
||||
NULL);
|
||||
for (fp = vp->fp, sp = vp->sp; fp; fp = SCM_FRAME_DYNAMIC_LINK (fp))
|
||||
{
|
||||
for (; sp >= &SCM_FRAME_LOCAL (fp, 0); sp--)
|
||||
{
|
||||
SCM elt = *sp;
|
||||
if (SCM_NIMP (elt))
|
||||
mark_stack_ptr = GC_MARK_AND_PUSH ((GC_word *) elt,
|
||||
mark_stack_ptr, mark_stack_limit,
|
||||
NULL);
|
||||
}
|
||||
sp = SCM_FRAME_PREVIOUS_SP (fp);
|
||||
}
|
||||
|
||||
return mark_stack_ptr;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue