Hello :-) On Tue 31 Jan 2012 19:02, l...@gnu.org (Ludovic Courtès) writes:
> "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? I don't think so. The question for me is, how far up the C stack does this get? For `stack-cleanup' (I have to learn how to type those nice quotes some day), there will never be more than one `1-' frame active on the C stack. With clear-stale-stack-references, there will be `depth' many. I think! Andy -- http://wingolog.org/