summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ice-9/boot-9.scm2
-rw-r--r--test-suite/tests/gc.test22
2 files changed, 15 insertions, 9 deletions
diff --git a/ice-9/boot-9.scm b/ice-9/boot-9.scm
index 6ada33c68..5a74f945f 100644
--- a/ice-9/boot-9.scm
+++ b/ice-9/boot-9.scm
@@ -1223,6 +1223,8 @@
;; We can't pass this as an argument to module-constructor,
;; because we need it to close over a pointer to the module
;; itself.
+ ;; FIXME: This creates a circular reference between MODULE and its
+ ;; standard eval closure which precludes them from being collected.
(set-module-eval-closure! module (standard-eval-closure module))
module))))
diff --git a/test-suite/tests/gc.test b/test-suite/tests/gc.test
index abd714b9a..d881aba17 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, 2007 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
@@ -59,13 +59,17 @@
(with-test-prefix "gc"
(pass-if "Unused modules are removed"
- (let*
- ((dummy (gc))
- (last-count (cdr (assoc
- "eval-closure" (gc-live-object-stats)))))
-
- (for-each (lambda (x) (make-module)) (iota 1000))
+ ;; FIXME: This test fails because of the circular reference
+ ;; created by `make-module' between the module itself and its
+ ;; standard eval closure.
+ (let* ((guard (make-guardian))
+ (total 1000))
+
+ (for-each (lambda (x) (guard (make-module))) (iota total))
(gc)
(gc) ;; twice: have to kill the weak vectors.
- (= last-count (cdr (assoc "eval-closure" (gc-live-object-stats)))))
- ))
+ (= (length (filter (lambda (x)
+ (eq? x #t))
+ (map (lambda (x) (and (guard) #t))
+ (iota total))))
+ total))))