From b3b842e5d8b31226cfaec011622401b2f5236454 Mon Sep 17 00:00:00 2001 From: wlott <wlott> Date: Sun, 17 Mar 1991 14:25:29 +0000 Subject: [PATCH] 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. --- code/gc.lisp | 56 ++++++++++++++++++++++++++++------------------------ 1 file changed, 30 insertions(+), 26 deletions(-) diff --git a/code/gc.lisp b/code/gc.lisp index 080af4915..7c3c4c183 100644 --- a/code/gc.lisp +++ b/code/gc.lisp @@ -1,14 +1,17 @@ ;;; -*- Mode: Lisp; Package: LISP; Log: code.log -*- ;;; ;;; ********************************************************************** -;;; This code was written as part of the Spice Lisp project at -;;; 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 Spice Lisp, please contact -;;; Scott Fahlman (Scott.Fahlman@CS.CMU.EDU). +;;; This code was written as part of the CMU Common Lisp project at +;;; Carnegie Mellon University, and has been placed in the public domain. +;;; If you want to use this code or any part of CMU Common Lisp, please contact +;;; Scott Fahlman or slisp-group@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. ;;; @@ -325,26 +328,27 @@ (carefully-funcall *gc-inhibit-hook* pre-gc-dyn-usage)) (return-from sub-gc nil)) (setf *gc-inhibit* nil) ; Reset *GC-INHIBIT* - (let ((*standard-output* *terminal-io*)) - (when verbose-p - (carefully-funcall *gc-notify-before* pre-gc-dyn-usage)) - (dolist (hook *before-gc-hooks*) - (carefully-funcall hook)) - (when *gc-trigger* - (clear-auto-gc-trigger)) - (funcall *internal-gc*) - (let* ((post-gc-dyn-usage (dynamic-usage)) - (bytes-freed (- pre-gc-dyn-usage post-gc-dyn-usage))) - (setf *need-to-collect-garbage* nil) - (setf *gc-trigger* - (+ post-gc-dyn-usage *bytes-consed-between-gcs*)) - (set-auto-gc-trigger *gc-trigger*) - (dolist (hook *after-gc-hooks*) - (carefully-funcall hook)) - (when verbose-p - (carefully-funcall *gc-notify-after* - post-gc-dyn-usage bytes-freed - *gc-trigger*))))))) + (without-interrupts + (let ((*standard-output* *terminal-io*)) + (when verbose-p + (carefully-funcall *gc-notify-before* pre-gc-dyn-usage)) + (dolist (hook *before-gc-hooks*) + (carefully-funcall hook)) + (when *gc-trigger* + (clear-auto-gc-trigger)) + (funcall *internal-gc*) + (let* ((post-gc-dyn-usage (dynamic-usage)) + (bytes-freed (- pre-gc-dyn-usage post-gc-dyn-usage))) + (setf *need-to-collect-garbage* nil) + (setf *gc-trigger* + (+ post-gc-dyn-usage *bytes-consed-between-gcs*)) + (set-auto-gc-trigger *gc-trigger*) + (dolist (hook *after-gc-hooks*) + (carefully-funcall hook)) + (when verbose-p + (carefully-funcall *gc-notify-after* + post-gc-dyn-usage bytes-freed + *gc-trigger*)))))))) nil) ;;; -- GitLab