Simplify GC daemon triggering loop to reduce overhead during GC.
authorChris Hanson <org/chris-hanson/cph>
Tue, 10 Dec 1991 23:24:16 +0000 (23:24 +0000)
committerChris Hanson <org/chris-hanson/cph>
Tue, 10 Dec 1991 23:24:16 +0000 (23:24 +0000)
v7/src/runtime/gcdemn.scm

index 5a6daf6763a985d98199c891d78e341f18e7bcad..6d62f2ab3e1d083528dbe5ac03428766afff90e4 100644 (file)
@@ -1,8 +1,8 @@
 #| -*-Scheme-*-
 
-$Header: /Users/cph/tmp/foo/mit-scheme/mit-scheme/v7/src/runtime/gcdemn.scm,v 14.3 1989/08/15 13:19:44 cph Rel $
+$Header: /Users/cph/tmp/foo/mit-scheme/mit-scheme/v7/src/runtime/gcdemn.scm,v 14.4 1991/12/10 23:24:16 cph Exp $
 
-Copyright (c) 1988, 1989 Massachusetts Institute of Technology
+Copyright (c) 1988-91 Massachusetts Institute of Technology
 
 This material was developed by the Scheme project at the Massachusetts
 Institute of Technology, Department of Electrical Engineering and
@@ -48,17 +48,14 @@ MIT in each case. |#
 (define secondary-gc-daemons)
 
 (define (trigger-gc-daemons)
-  (trigger-daemons gc-daemons))
+  (do ((daemons gc-daemons (cdr daemons)))
+      ((null? daemons))
+    ((car daemons))))
 
 (define (trigger-secondary-gc-daemons!)
-  (trigger-daemons secondary-gc-daemons))
-
-(define (trigger-daemons daemons . extra-args)
-  (let loop ((daemons daemons))
-    (if (not (null? daemons))
-       (begin
-         (apply (car daemons) extra-args)
-         (loop (cdr daemons))))))
+  (do ((daemons secondary-gc-daemons (cdr daemons)))
+      ((null? daemons))
+    ((car daemons))))
 
 (define (add-gc-daemon! daemon)
   (set! gc-daemons (cons daemon gc-daemons))