X-Git-Url: http://repo.macrolet.net/gitweb/?a=blobdiff_plain;f=src%2Fcode%2Fgc.lisp;h=042ab05e61b5c9d48d148f7c73998af5437980fb;hb=eaec8176060e89efa39f01017df1f6204e491ecc;hp=9c9856146ae3a74eb95fb729ba9cfa5b3f32c612;hpb=4ec0d70e08ea4b512d45ddbd6c82e8f6a91a914f;p=sbcl.git diff --git a/src/code/gc.lisp b/src/code/gc.lisp index 9c98561..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 @@ -346,7 +351,9 @@ collection is initiated. This can be set with SETF." (number-of-gcs int) (number-of-gcs-before-promotion int) (cum-sum-bytes-allocated unsigned-long) - (minimum-age-before-gc double))) + (minimum-age-before-gc double) + ;; `struct lutex *' or `void *', depending. + (lutexes (* char)))) #!+gencgc (define-alien-variable generations @@ -358,22 +365,24 @@ collection is initiated. This can be set with SETF." (defun ,(symbolicate "GENERATION-" slot) (generation) #!+sb-doc ,doc + #!+gencgc (declare (generation-index generation)) #!-gencgc (declare (ignore generation)) #!-gencgc (error "~S is a GENCGC only function and unavailable in this build" - ',name) + ',slot) #!+gencgc (slot (deref generations generation) ',slot)) ,@(when setfp `((defun (setf ,(symbolicate "GENERATION-" slot)) (value generation) + #!+gencgc (declare (generation-index generation)) #!-gencgc (declare (ignore value generation)) #!-gencgc (error "(SETF ~S) is a GENCGC only function and unavailable in this build" - ',name) + ',slot) #!+gencgc (setf (slot (deref generations generation) ',slot) value))))))) (def bytes-consed-between-gcs @@ -415,6 +424,7 @@ objects allocated to the generation have seen younger objects promoted to it. Available on GENCGC platforms only. Experimental: interface subject to change." + #!+gencgc (declare (generation-index generation)) #!-gencgc (declare (ignore generation)) #!-gencgc