X-Git-Url: http://repo.macrolet.net/gitweb/?a=blobdiff_plain;f=src%2Fcode%2Fgc.lisp;h=f66fbe171ef731e885d2b2f64c2929e0901f2c33;hb=90ca09b75fbc3b63b2f7d09c67b04b866dd783f6;hp=5ed0b353cfd5a324a9a8fc9987df564a4be4ede6;hpb=bde2d08778488aba0ff0c30bc0afb17fbdacb4e4;p=sbcl.git diff --git a/src/code/gc.lisp b/src/code/gc.lisp index 5ed0b35..f66fbe1 100644 --- a/src/code/gc.lisp +++ b/src/code/gc.lisp @@ -42,11 +42,11 @@ (current-dynamic-space-start)))) (defun static-space-usage () - (- (* sb!vm:*static-space-free-pointer* sb!vm:word-bytes) + (- (* sb!vm:*static-space-free-pointer* sb!vm:n-word-bytes) sb!vm:static-space-start)) (defun read-only-space-usage () - (- (* sb!vm::*read-only-space-free-pointer* sb!vm:word-bytes) + (- (* sb!vm::*read-only-space-free-pointer* sb!vm:n-word-bytes) sb!vm:read-only-space-start)) (defun control-stack-usage () @@ -140,7 +140,7 @@ 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* (* 2 (expt 10 6))) +(defvar *bytes-consed-between-gcs* (* 4 (expt 10 6))) (declaim (type index *bytes-consed-between-gcs*)) ;;;; GC hooks @@ -203,10 +203,11 @@ and submit it as a patch." (defun default-gc-notify-before (notify-stream bytes-in-use) (declare (type stream notify-stream)) - (format notify-stream - "~&; GC is beginning with ~:D bytes in use at internal runtime ~:D.~%" - bytes-in-use - (get-internal-run-time)) + (format + notify-stream + "~&; GC is beginning with ~:D bytes in use at internal runtime ~:D.~%" + bytes-in-use + (get-internal-run-time)) (finish-output notify-stream)) (defparameter *gc-notify-before* #'default-gc-notify-before #!+sb-doc @@ -230,21 +231,21 @@ and submit it as a patch." (finish-output notify-stream)) (defparameter *gc-notify-after* #'default-gc-notify-after #!+sb-doc - "The function bound to this variable is invoked after GC'ing with -the value of *GC-NOTIFY-STREAM*, the amount of dynamic usage (in -bytes) now free, the number of bytes freed by the GC, and the new GC -trigger threshold. The function should notify the user that the system -has finished GC'ing.") + "The function bound to this variable is invoked after GC'ing with the +value of *GC-NOTIFY-STREAM*, the amount of dynamic usage (in bytes) now +free, the number of bytes freed by the GC, and the new GC trigger +threshold; or if *GC-NOTIFY-STREAM* is NIL, it's not invoked. The +function should notify the user that the system has finished GC'ing.") ;;;; internal GC -(sb!alien:def-alien-routine collect-garbage sb!c-call:int +(sb!alien:define-alien-routine collect-garbage sb!c-call:int #!+gencgc (last-gen sb!c-call:int)) -(sb!alien:def-alien-routine set-auto-gc-trigger sb!c-call:void +(sb!alien:define-alien-routine set-auto-gc-trigger sb!c-call:void (dynamic-usage sb!c-call:unsigned-long)) -(sb!alien:def-alien-routine clear-auto-gc-trigger sb!c-call:void) +(sb!alien:define-alien-routine clear-auto-gc-trigger sb!c-call: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 @@ -253,7 +254,7 @@ has finished GC'ing.") ;;;; SUB-GC -;;; Used to carefully invoke hooks. +;;; This is used to carefully invoke hooks. (eval-when (:compile-toplevel :execute) (sb!xc:defmacro carefully-funcall (function &rest args) `(handler-case (funcall ,function ,@args) @@ -284,7 +285,7 @@ has finished GC'ing.") *soft-heap-limit*))) (when soft-heap-limit-exceeded? (cerror "Continue with GC." - "soft heap limit exceeded (temporary new limit=~D)" + "soft heap limit exceeded (temporary new limit=~W)" *soft-heap-limit*)) (when (and *gc-trigger* (> pre-gc-dynamic-usage *gc-trigger*)) (setf *need-to-collect-garbage* t))