X-Git-Url: http://repo.macrolet.net/gitweb/?a=blobdiff_plain;f=src%2Fcode%2Fgc.lisp;h=45577a0db9f9e9bfcef4a5bbad2da146991f03e5;hb=92a258eda6d6f0cadd1251200285671ec92aa45f;hp=f66fbe171ef731e885d2b2f64c2929e0901f2c33;hpb=e33fb894f991b2926d8f3bace9058e4c0b2c3a37;p=sbcl.git diff --git a/src/code/gc.lisp b/src/code/gc.lisp index f66fbe1..45577a0 100644 --- a/src/code/gc.lisp +++ b/src/code/gc.lisp @@ -50,10 +50,12 @@ sb!vm:read-only-space-start)) (defun control-stack-usage () - #!-x86 (- (sb!sys:sap-int (sb!c::control-stack-pointer-sap)) - sb!vm:control-stack-start) - #!+x86 (- sb!vm:control-stack-end - (sb!sys:sap-int (sb!c::control-stack-pointer-sap)))) + #!-stack-grows-downward-not-upward + (- (sb!sys:sap-int (sb!c::control-stack-pointer-sap)) + sb!vm:control-stack-start) + #!+stack-grows-downward-not-upward + (- sb!vm:control-stack-end + (sb!sys:sap-int (sb!c::control-stack-pointer-sap)))) (defun binding-stack-usage () (- (sb!sys:sap-int (sb!c::binding-stack-pointer-sap)) @@ -74,7 +76,7 @@ (room-minimal-info) (sb!vm:memory-usage :count-spaces '(:dynamic) :print-spaces t - :cutoff 0.05s0 + :cutoff 0.05f0 :print-summary nil)) (defun room-maximal-info () @@ -140,7 +142,14 @@ and submit it as a patch." ;;; ;;; Unlike CMU CL, we don't export this variable. (There's no need to, ;;; since our BYTES-CONSED-BETWEEN-GCS function is SETFable.) -(defvar *bytes-consed-between-gcs* (* 4 (expt 10 6))) +(defvar *bytes-consed-between-gcs* + #!+gencgc (* 4 (expt 10 6)) + ;; Stop-and-copy GC is really really slow when used too often. CSR + ;; reported that even on his old 64 Mb SPARC, 20 Mb is much faster + ;; than 4 Mb when rebuilding SBCL ca. 0.7.1. For modern machines + ;; with >> 128 Mb memory, the optimum could be significantly more + ;; than this, but at least 20 Mb should be better than 4 Mb. + #!-gencgc (* 20 (expt 10 6))) (declaim (type index *bytes-consed-between-gcs*)) ;;;; GC hooks @@ -239,13 +248,13 @@ function should notify the user that the system has finished GC'ing.") ;;;; internal GC -(sb!alien:define-alien-routine collect-garbage sb!c-call:int - #!+gencgc (last-gen sb!c-call:int)) +(sb!alien:define-alien-routine collect-garbage sb!alien:int + #!+gencgc (last-gen sb!alien:int)) -(sb!alien:define-alien-routine set-auto-gc-trigger sb!c-call:void - (dynamic-usage sb!c-call:unsigned-long)) +(sb!alien:define-alien-routine set-auto-gc-trigger sb!alien:void + (dynamic-usage sb!alien:unsigned-long)) -(sb!alien:define-alien-routine clear-auto-gc-trigger sb!c-call:void) +(sb!alien:define-alien-routine clear-auto-gc-trigger sb!alien:void) ;;; This variable contains the function that does the real GC. This is ;;; for low-level GC experimentation. Do not touch it if you do not