Installation Instructions
*************************
-Copyright (C) 1994, 1995, 1996, 1999, 2000, 2001, 2002, 2004 Free
+Copyright (C) 1994, 1995, 1996, 1999, 2000, 2001, 2002, 2004, 2005 Free
Software Foundation, Inc.
This file is free documentation; the Free Software Foundation gives
./configure CC=/usr/local2/bin/gcc
-will cause the specified gcc to be used as the C compiler (unless it is
-overridden in the site shell script).
+causes the specified `gcc' to be used as the C compiler (unless it is
+overridden in the site shell script). Here is a another example:
+
+ /bin/bash ./configure CONFIG_SHELL=/bin/bash
+
+Here the `CONFIG_SHELL=/bin/bash' operand causes subsequent
+configuration-related scripts to be executed by `/bin/bash'.
`configure' Invocation
======================
+2005-06-10 Han-Wen Nienhuys <hanwen@xs4all.nl>
+
+ * boot-9.scm (set-module-eval-closure!): remove
+ set-procedure-property! closure 'module. Setting this property
+ causes un-gc-able modules.
+
2005-06-05 Marius Vollmer <mvo@zagadka.de>
* boot-9.scm (substring-fill!): New, for compatability.
(define (environment-module env)
(let ((closure (and (pair? env) (car (last-pair env)))))
- (and closure (procedure-property closure 'module))))
+ (and closure (eval-closure-module closure))))
\f
(let ((setter (record-modifier module-type 'eval-closure)))
(lambda (module closure)
(setter module closure)
- ;; Make it possible to lookup the module from the environment.
- ;; This implementation is correct since an eval closure can belong
- ;; to maximally one module.
- (set-procedure-property! closure 'module module))))
+
+ ;; do not set procedure properties on closures.
+ ;; since procedure properties are weak-hashes, they cannot
+ ;; have cyclical data, otherwise the data cannot be GC-ed.
+ )))
\f
(exports '())
(re-exports '())
(replacements '()))
+
(if (null? kws)
(call-with-deferred-observers
(lambda ()
+2005-06-10 Han-Wen Nienhuys <hanwen@xs4all.nl>
+
+ * modules.c (s_scm_eval_closure_module): new function. Return the
+ module inside an eval-closure.
+
+ * gc.c (scm_init_storage): make scm_stand_in_procs a weak_key hash
+ table. This means that procedure properties are GC'd if the
+ procedure dies.
+
2005-06-11 Kevin Ryde <user42@zip.com.au>
* srfi-13.c (scm_string_filter, scm_string_delete): For char and
#endif
- scm_stand_in_procs = scm_c_make_hash_table (257);
+ scm_stand_in_procs = scm_make_weak_key_hash_table (scm_from_int (257));
scm_permobjs = SCM_EOL;
scm_protects = scm_c_make_hash_table (31);
scm_gc_registered_roots = scm_c_make_hash_table (31);
}
#undef FUNC_NAME
+
+SCM_DEFINE (scm_eval_closure_module, "eval-closure-module", 1, 0, 0,
+ (SCM closure),
+ "Return the module for @var{closure}.")
+#define FUNC_NAME s_scm_eval_closure_module
+{
+ SCM_ASSERT_TYPE(SCM_EVAL_CLOSURE_P (closure), closure, SCM_ARG1, FUNC_NAME, "eval-closure");
+ return SCM_PACK (SCM_CELL_WORD_1(closure));
+}
+#undef FUNC_NAME
+
+
+
SCM_DEFINE (scm_standard_interface_eval_closure,
"standard-interface-eval-closure", 1, 0, 0,
(SCM module),
SCM_API SCM scm_current_module_transformer (void);
SCM_API SCM scm_eval_closure_lookup (SCM eclo, SCM sym, SCM definep);
SCM_API SCM scm_standard_eval_closure (SCM module);
+SCM_API SCM scm_eval_closure_module (SCM closure);
SCM_API SCM scm_standard_interface_eval_closure (SCM module);
SCM_API SCM scm_get_pre_modules_obarray (void);
SCM_API SCM scm_lookup_closure_module (SCM proc);
+2005-06-10 Han-Wen Nienhuys <hanwen@xs4all.nl>
+
+ * tests/gc.test ("gc"): add a test to verify that modules are
+ garbage collected.
+
2005-06-11 Kevin Ryde <user42@zip.com.au>
* tests/srfi-13.test (string-filter): A few more tests.
(gc)
(remove-hook! after-gc-hook thunk)
foo)))
+
+
+(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))
+ (gc)
+ (gc) ;; twice: have to kill the weak vectors.
+ (= last-count (cdr (assoc "eval-closure" (gc-live-object-stats)))))
+ ))
;;;
;;; hashx-remove!
;;;
-
(with-test-prefix "hashx-remove!"
(pass-if (->bool (object-documentation hashx-remove!)))