X-Git-Url: http://repo.macrolet.net/gitweb/?a=blobdiff_plain;f=src%2Fcode%2Fgc.lisp;h=042ab05e61b5c9d48d148f7c73998af5437980fb;hb=cc24446c5ba765a69c0465832f1ed43227fccd47;hp=eb7f13dc644382a0daebeb596ee8b1a0d4e48f68;hpb=3fa2feb10ab827fc6cc2a85287e78b6e66b7bf4d;p=sbcl.git diff --git a/src/code/gc.lisp b/src/code/gc.lisp index eb7f13d..042ab05 100644 --- a/src/code/gc.lisp +++ b/src/code/gc.lisp @@ -224,8 +224,13 @@ run in any thread.") (let ((start-time (get-internal-run-time))) (collect-garbage gen) (setf *gc-epoch* (cons nil nil)) - (incf *gc-run-time* - (- (get-internal-run-time) start-time))) + (let ((run-time (- (get-internal-run-time) start-time))) + ;; KLUDGE: Sometimes we see the second getrusage() call + ;; return a smaller value than the first, which can + ;; lead to *GC-RUN-TIME* to going negative, which in + ;; turn is a type-error. + (when (plusp run-time) + (incf *gc-run-time* run-time)))) (setf *gc-pending* nil new-usage (dynamic-usage)) #!+sb-thread