mirror of
https://git.savannah.gnu.org/git/guile.git
synced 2025-04-30 11:50:28 +02:00
Fix continuation marking, and some tests.
* libguile/continuations.c (continuation_mark): Mark the vm continuations. * libguile/vm.c (vm_cont_mark): Fix the marking function. (vm_mark): Fix this one too -- the size is a number of STACKITEMS, which we foolishly assume are the same size as SCM. * test-suite/tests/ftw.test: Make our stat hacks verifyable without assuming that they are interpreted. * test-suite/tests/r5rs_pitfall.test: Re-indent.
This commit is contained in:
parent
107139eaad
commit
7ff017002d
4 changed files with 28 additions and 28 deletions
|
@ -51,6 +51,7 @@ continuation_mark (SCM obj)
|
||||||
|
|
||||||
scm_gc_mark (continuation->root);
|
scm_gc_mark (continuation->root);
|
||||||
scm_gc_mark (continuation->throw_value);
|
scm_gc_mark (continuation->throw_value);
|
||||||
|
scm_gc_mark (continuation->vm_conts);
|
||||||
scm_mark_locations (continuation->stack, continuation->num_stack_items);
|
scm_mark_locations (continuation->stack, continuation->num_stack_items);
|
||||||
#ifdef __ia64__
|
#ifdef __ia64__
|
||||||
if (continuation->backing_store)
|
if (continuation->backing_store)
|
||||||
|
|
|
@ -80,16 +80,14 @@ struct scm_vm_cont {
|
||||||
static SCM
|
static SCM
|
||||||
vm_cont_mark (SCM obj)
|
vm_cont_mark (SCM obj)
|
||||||
{
|
{
|
||||||
scm_t_ptrdiff i, size;
|
size_t size;
|
||||||
SCM *stack;
|
SCM *stack;
|
||||||
|
|
||||||
stack = SCM_VM_CONT_DATA (obj)->stack_base;
|
stack = SCM_VM_CONT_DATA (obj)->stack_base;
|
||||||
size = SCM_VM_CONT_DATA (obj)->stack_size;
|
size = SCM_VM_CONT_DATA (obj)->stack_size;
|
||||||
|
|
||||||
/* we could be smarter about this. */
|
/* we could be smarter about this. */
|
||||||
for (i = 0; i < size; i ++)
|
scm_mark_locations ((SCM_STACKITEM *) stack, size);
|
||||||
if (SCM_NIMP (stack[i]))
|
|
||||||
scm_gc_mark (stack[i]);
|
|
||||||
|
|
||||||
return SCM_BOOL_F;
|
return SCM_BOOL_F;
|
||||||
}
|
}
|
||||||
|
@ -333,7 +331,7 @@ vm_mark (SCM obj)
|
||||||
|
|
||||||
/* mark the stack conservatively */
|
/* mark the stack conservatively */
|
||||||
scm_mark_locations ((SCM_STACKITEM *) vp->stack_base,
|
scm_mark_locations ((SCM_STACKITEM *) vp->stack_base,
|
||||||
sizeof (SCM) * (vp->sp - vp->stack_base + 1));
|
vp->sp - vp->stack_base + 1);
|
||||||
|
|
||||||
/* mark other objects */
|
/* mark other objects */
|
||||||
for (i = 0; i < SCM_VM_NUM_HOOKS; i++)
|
for (i = 0; i < SCM_VM_NUM_HOOKS; i++)
|
||||||
|
|
|
@ -25,18 +25,19 @@
|
||||||
;; what ice-9/posix.scm stat:dev and stat:ino do (which in turn match
|
;; what ice-9/posix.scm stat:dev and stat:ino do (which in turn match
|
||||||
;; libguile/filesys.c of course)
|
;; libguile/filesys.c of course)
|
||||||
|
|
||||||
(or (equal? (procedure-source stat:dev)
|
|
||||||
'(lambda (f) (vector-ref f 0)))
|
|
||||||
(error "oops, unexpected stat:dev definition"))
|
|
||||||
(define (stat:dev! st dev)
|
(define (stat:dev! st dev)
|
||||||
(vector-set! st 0 dev))
|
(vector-set! st 0 dev))
|
||||||
|
|
||||||
(or (equal? (procedure-source stat:ino)
|
|
||||||
'(lambda (f) (vector-ref f 1)))
|
|
||||||
(error "oops, unexpected stat:ino definition"))
|
|
||||||
(define (stat:ino! st ino)
|
(define (stat:ino! st ino)
|
||||||
(vector-set! st 1 ino))
|
(vector-set! st 1 ino))
|
||||||
|
|
||||||
|
(let* ((s (stat "/"))
|
||||||
|
(i (stat:ino s))
|
||||||
|
(d (stat:dev s)))
|
||||||
|
(stat:ino! s (1+ i))
|
||||||
|
(stat:dev! s (1+ d))
|
||||||
|
(if (not (and (= (stat:ino s) (1+ i))
|
||||||
|
(= (stat:dev s) (1+ d))))
|
||||||
|
(error "unexpected definitions of stat:dev and stat:ino")))
|
||||||
|
|
||||||
;;
|
;;
|
||||||
;; visited?-proc
|
;; visited?-proc
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue