Hi!

"Andy Wingo" <wi...@pobox.com> skribis:

> +;; Recurse through a C function that should clear any values that might
> +;; have spilled on the stack temporarily.  (The salient feature of
> +;; with-continuation-barrier is that currently it is implemented as a C
> +;; function that recursively calls the VM.)
> +;;
> +(define* (clear-stale-stack-references #:optional (n 10))
> +  (if (positive? n)
> +      (with-continuation-barrier
> +       (lambda ()
> +         (clear-stale-stack-references (1- n))))))
> +
>  ;;; Call THUNK with a given locale
>  (define (with-locale* nloc thunk)
>    (let ((loc #f))
> diff --git a/test-suite/tests/gc.test b/test-suite/tests/gc.test
> index 97eeb19..1afcea3 100644
> --- a/test-suite/tests/gc.test
> +++ b/test-suite/tests/gc.test
> @@ -49,13 +49,6 @@
>  ;;; 
>  ;;;
>  
> -(define (stack-cleanup depth)
> -  ;; Clean up stack space for DEPTH words.  This is defined here so that
> -  ;; `peval' doesn't inline it.
> -  (let cleanup ((i depth))
> -    (and (> i 0)
> -         (begin (cleanup (1- i)) i))))
> -

Note that ‘1-’ here is a subr call (because ‘stack-cleanup’ is
interpreted), so both procedures may have a similar effect, no?

Thanks,
Ludo’.

Reply via email to