Skip to content
Snippets Groups Projects
Commit b3b842e5 authored by wlott's avatar wlott
Browse files

Wrapped a without-interrupts around the guts of maybe-gc so that the

notify messages and state updates don't get seperated from the actual
gc.
parent 4bdbec90
No related branches found
No related tags found
No related merge requests found
;;; -*- Mode: Lisp; Package: LISP; Log: code.log -*- ;;; -*- Mode: Lisp; Package: LISP; Log: code.log -*-
;;; ;;;
;;; ********************************************************************** ;;; **********************************************************************
;;; This code was written as part of the Spice Lisp project at ;;; This code was written as part of the CMU Common Lisp project at
;;; Carnegie-Mellon University, and has been placed in the public domain. ;;; Carnegie Mellon University, and has been placed in the public domain.
;;; Spice Lisp is currently incomplete and under active development. ;;; If you want to use this code or any part of CMU Common Lisp, please contact
;;; If you want to use this code or any part of Spice Lisp, please contact ;;; Scott Fahlman or slisp-group@cs.cmu.edu.
;;; Scott Fahlman (Scott.Fahlman@CS.CMU.EDU). ;;;
(ext:file-comment
"$Header: /Volumes/share2/src/cmucl/cvs2git/cvsroot/src/code/gc.lisp,v 1.6 1991/03/17 14:25:29 wlott Exp $")
;;;
;;; ********************************************************************** ;;; **********************************************************************
;;; ;;;
;;; $Header: /Volumes/share2/src/cmucl/cvs2git/cvsroot/src/code/gc.lisp,v 1.5 1990/10/13 04:51:06 wlott Exp $ ;;; $Header: /Volumes/share2/src/cmucl/cvs2git/cvsroot/src/code/gc.lisp,v 1.6 1991/03/17 14:25:29 wlott Exp $
;;; ;;;
;;; Garbage collection and allocation related code. ;;; Garbage collection and allocation related code.
;;; ;;;
...@@ -325,26 +328,27 @@ ...@@ -325,26 +328,27 @@
(carefully-funcall *gc-inhibit-hook* pre-gc-dyn-usage)) (carefully-funcall *gc-inhibit-hook* pre-gc-dyn-usage))
(return-from sub-gc nil)) (return-from sub-gc nil))
(setf *gc-inhibit* nil) ; Reset *GC-INHIBIT* (setf *gc-inhibit* nil) ; Reset *GC-INHIBIT*
(let ((*standard-output* *terminal-io*)) (without-interrupts
(when verbose-p (let ((*standard-output* *terminal-io*))
(carefully-funcall *gc-notify-before* pre-gc-dyn-usage)) (when verbose-p
(dolist (hook *before-gc-hooks*) (carefully-funcall *gc-notify-before* pre-gc-dyn-usage))
(carefully-funcall hook)) (dolist (hook *before-gc-hooks*)
(when *gc-trigger* (carefully-funcall hook))
(clear-auto-gc-trigger)) (when *gc-trigger*
(funcall *internal-gc*) (clear-auto-gc-trigger))
(let* ((post-gc-dyn-usage (dynamic-usage)) (funcall *internal-gc*)
(bytes-freed (- pre-gc-dyn-usage post-gc-dyn-usage))) (let* ((post-gc-dyn-usage (dynamic-usage))
(setf *need-to-collect-garbage* nil) (bytes-freed (- pre-gc-dyn-usage post-gc-dyn-usage)))
(setf *gc-trigger* (setf *need-to-collect-garbage* nil)
(+ post-gc-dyn-usage *bytes-consed-between-gcs*)) (setf *gc-trigger*
(set-auto-gc-trigger *gc-trigger*) (+ post-gc-dyn-usage *bytes-consed-between-gcs*))
(dolist (hook *after-gc-hooks*) (set-auto-gc-trigger *gc-trigger*)
(carefully-funcall hook)) (dolist (hook *after-gc-hooks*)
(when verbose-p (carefully-funcall hook))
(carefully-funcall *gc-notify-after* (when verbose-p
post-gc-dyn-usage bytes-freed (carefully-funcall *gc-notify-after*
*gc-trigger*))))))) post-gc-dyn-usage bytes-freed
*gc-trigger*))))))))
nil) nil)
;;; ;;;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment