From f937ce3741184ba2f3ee3c70bfd0caa057207c98 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ludovic=20Court=C3=A8s?= Date: Fri, 15 Feb 2008 16:02:22 +0000 Subject: [PATCH] Add `gc.test' hack for SPARC GNU/Linux. --- test-suite/ChangeLog | 5 +++++ test-suite/tests/gc.test | 13 +++++++++++-- 2 files changed, 16 insertions(+), 2 deletions(-) diff --git a/test-suite/ChangeLog b/test-suite/ChangeLog index 5040c164d..212c67af2 100644 --- a/test-suite/ChangeLog +++ b/test-suite/ChangeLog @@ -1,3 +1,8 @@ +2008-02-15 Ludovic Courtès + + * tests/gc.test (gc): Add hack to clean up the stack so that the + test passes on SPARC. + 2008-02-01 Neil Jerram * standalone/Makefile.am: Add stanza for test-with-guile-module. diff --git a/test-suite/tests/gc.test b/test-suite/tests/gc.test index abd714b9a..badf2b79c 100644 --- a/test-suite/tests/gc.test +++ b/test-suite/tests/gc.test @@ -1,5 +1,5 @@ ;;;; gc.test --- test guile's garbage collection -*- scheme -*- -;;;; Copyright (C) 2000, 2001, 2004, 2006 Free Software Foundation, Inc. +;;;; Copyright (C) 2000, 2001, 2004, 2006, 2008 Free Software Foundation, Inc. ;;;; ;;;; This library is free software; you can redistribute it and/or ;;;; modify it under the terms of the GNU Lesser General Public @@ -63,8 +63,17 @@ ((dummy (gc)) (last-count (cdr (assoc "eval-closure" (gc-live-object-stats))))) - + (for-each (lambda (x) (make-module)) (iota 1000)) + + ;; XXX: This hack aims to clean up the stack to make sure we + ;; don't leave a reference to one of the modules we created. It + ;; proved to be useful on SPARC: + ;; http://lists.gnu.org/archive/html/guile-devel/2008-02/msg00006.html . + (let cleanup ((i 10)) + (and (> i 0) + (begin (cleanup (1- i)) i))) + (gc) (gc) ;; twice: have to kill the weak vectors. (= last-count (cdr (assoc "eval-closure" (gc-live-object-stats)))))