From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: ludo@gnu.org (Ludovic =?iso-8859-1?Q?Court=E8s?=) Newsgroups: gmane.lisp.guile.devel Subject: Clearing stale references from the stack Date: Tue, 31 Jan 2012 19:02:03 +0100 Message-ID: <87wr87eoo4.fsf@gnu.org> References: NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Trace: dough.gmane.org 1328032944 25398 80.91.229.3 (31 Jan 2012 18:02:24 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Tue, 31 Jan 2012 18:02:24 +0000 (UTC) Cc: guile-devel@gnu.org To: "Andy Wingo" Original-X-From: guile-devel-bounces+guile-devel=m.gmane.org@gnu.org Tue Jan 31 19:02:23 2012 Return-path: Envelope-to: guile-devel@m.gmane.org Original-Received: from lists.gnu.org ([140.186.70.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1RsI25-00049r-QZ for guile-devel@m.gmane.org; Tue, 31 Jan 2012 19:02:17 +0100 Original-Received: from localhost ([::1]:52770 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RsI25-00085q-D6 for guile-devel@m.gmane.org; Tue, 31 Jan 2012 13:02:17 -0500 Original-Received: from eggs.gnu.org ([140.186.70.92]:46153) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RsI1z-00085E-Rl for guile-devel@gnu.org; Tue, 31 Jan 2012 13:02:15 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1RsI1t-0004dt-3P for guile-devel@gnu.org; Tue, 31 Jan 2012 13:02:11 -0500 Original-Received: from mail4-relais-sop.national.inria.fr ([192.134.164.105]:37835) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RsI1s-0004dp-R5 for guile-devel@gnu.org; Tue, 31 Jan 2012 13:02:05 -0500 X-IronPort-AV: E=Sophos;i="4.71,597,1320620400"; d="scan'208";a="129584605" Original-Received: from unknown (HELO pluto) ([193.50.110.167]) by mail4-relais-sop.national.inria.fr with ESMTP/TLS/DHE-RSA-AES128-SHA; 31 Jan 2012 19:02:03 +0100 X-URL: http://www.fdn.fr/~lcourtes/ X-Revolutionary-Date: 12 =?iso-8859-1?Q?Pluvi=F4se?= an 220 de la =?iso-8859-1?Q?R=E9volution?= X-PGP-Key-ID: 0xEA52ECF4 X-PGP-Key: http://www.fdn.fr/~lcourtes/ludovic.asc X-PGP-Fingerprint: 83C4 F8E5 10A3 3B4C 5BEA D15D 77DD 95E2 EA52 ECF4 X-OS: x86_64-unknown-linux-gnu In-Reply-To: (Andy Wingo's message of "Tue, 31 Jan 2012 16:58:40 +0000") User-Agent: Gnus/5.110018 (No Gnus v0.18) Emacs/24.0.93 (gnu/linux) X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 192.134.164.105 X-BeenThere: guile-devel@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "Developers list for Guile, the GNU extensibility library" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guile-devel-bounces+guile-devel=m.gmane.org@gnu.org Original-Sender: guile-devel-bounces+guile-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.lisp.guile.devel:13764 Archived-At: Hi! "Andy Wingo" 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 @@ > ;;;=20 > ;;; >=20=20 > -(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 =E2=80=981-=E2=80=99 here is a subr call (because =E2=80=98stack-= cleanup=E2=80=99 is interpreted), so both procedures may have a similar effect, no? Thanks, Ludo=E2=80=99.