X-Git-Url: http://repo.macrolet.net/gitweb/?a=blobdiff_plain;f=src%2Fcode%2Fgc.lisp;h=1df184dad6c545066a5aa3742b612e7e8bdc5659;hb=dc9fb9111cb1b645aaede0d3ec019c0f78200be0;hp=c4f84de5e215581ff948e5111e74a00ec0dce398;hpb=a01e7ac2e8a9f3afae8f759381a0829fceb5bfde;p=sbcl.git diff --git a/src/code/gc.lisp b/src/code/gc.lisp index c4f84de..1df184d 100644 --- a/src/code/gc.lisp +++ b/src/code/gc.lisp @@ -125,7 +125,7 @@ ;; See comment in interr.lisp *heap-exhausted-error-condition* (make-condition 'heap-exhausted-error))) -(declaim (ftype (function () unsigned-byte) get-bytes-consed)) +(declaim (ftype (sfunction () unsigned-byte) get-bytes-consed)) (defun get-bytes-consed () #!+sb-doc "Return the number of bytes consed since the program began. Typically @@ -177,8 +177,7 @@ run in any thread.") ;;; For GENCGC all generations < GEN will be GC'ed. -(defvar *already-in-gc* - (sb!thread:make-mutex :name "GC lock") "ID of thread running SUB-GC") +(defvar *already-in-gc* (sb!thread:make-mutex :name "GC lock")) ;;; A unique GC id. This is supplied for code that needs to detect ;;; whether a GC has happened since some earlier point in time. For @@ -197,8 +196,7 @@ run in any thread.") (defvar *gc-epoch* (cons nil nil)) (defun sub-gc (&key (gen 0)) - (unless (eq sb!thread:*current-thread* - (sb!thread:mutex-value *already-in-gc*)) + (unless (sb!thread:holding-mutex-p *already-in-gc*) ;; With gencgc, unless *GC-PENDING* every allocation in this ;; function triggers another gc, potentially exceeding maximum ;; interrupt nesting. If *GC-INHIBIT* is not true, however,