0.9.1.59:
[sbcl.git] / src / code / gc.lisp
index 6daa745..43c2b07 100644 (file)
@@ -24,7 +24,7 @@
 #!-sb-fluid
 (declaim (inline current-dynamic-space-start))
 #!+gencgc
-(defun current-dynamic-space-spart () sb!vm:dynamic-space-start)
+(defun current-dynamic-space-start () sb!vm:dynamic-space-start)
 #!-gencgc
 (def-c-var-fun current-dynamic-space-start "current_dynamic_space")
 
@@ -210,6 +210,9 @@ environment these hooks may run in any thread.")
 (defun sub-gc (&key (gen 0))
   (unless (eql (sb!thread:current-thread-id)
               (sb!thread::mutex-value *already-in-gc*))
+    ;; With gencgc, unless *NEED-TO-COLLECT-GARBAGE* every allocation
+    ;; in this function triggers another gc, potentially exceeding
+    ;; maximum interrupt nesting.
     (setf *need-to-collect-garbage* t)
     (when (zerop *gc-inhibit*)
       (sb!thread:with-mutex (*already-in-gc*)
@@ -233,8 +236,10 @@ environment these hooks may run in any thread.")
            ;; of things and not a bug.
            (when (plusp freed)
              (incf *n-bytes-freed-or-purified* freed)))
-         (sb!thread::reap-dead-threads)))
-      ;; Outside the mutex, these may cause another GC.
+          (sb!thread::reap-dead-threads)))
+      ;; Outside the mutex, these may cause another GC. FIXME: it can
+      ;; potentially exceed maximum interrupt nesting by triggering
+      ;; GCs.
       (run-pending-finalizers)
       (dolist (hook *after-gc-hooks*)
        (handler-case