From 527a655eb1e3482e6b7c88f6efafe8f530f4d524 Mon Sep 17 00:00:00 2001 From: "Guillermo J. Rozas" Date: Fri, 7 Feb 1992 19:47:41 +0000 Subject: [PATCH] Make gc-abort-test act differently during the boot load, rather than fail because of an unassigned variable. --- v7/src/runtime/gc.scm | 34 ++++++++++++++++++++++++---------- v7/src/runtime/make.scm | 6 ++++-- v7/src/runtime/version.scm | 6 +++--- v8/src/runtime/make.scm | 6 ++++-- 4 files changed, 35 insertions(+), 17 deletions(-) diff --git a/v7/src/runtime/gc.scm b/v7/src/runtime/gc.scm index 4a456a4e6..e5c10f33b 100644 --- a/v7/src/runtime/gc.scm +++ b/v7/src/runtime/gc.scm @@ -1,8 +1,8 @@ #| -*-Scheme-*- -$Header: /Users/cph/tmp/foo/mit-scheme/mit-scheme/v7/src/runtime/gc.scm,v 14.7 1991/11/26 07:06:03 cph Exp $ +$Header: /Users/cph/tmp/foo/mit-scheme/mit-scheme/v7/src/runtime/gc.scm,v 14.8 1992/02/07 19:47:24 jinx Exp $ -Copyright (c) 1988-91 Massachusetts Institute of Technology +Copyright (c) 1988-1992 Massachusetts Institute of Technology This material was developed by the Scheme project at the Massachusetts Institute of Technology, Department of Electrical Engineering and @@ -38,6 +38,7 @@ MIT in each case. |# (declare (usual-integrations)) (define (initialize-package!) + (set! gc-boot-loading? true) (set! hook/gc-flip default/gc-flip) (set! hook/purify default/purify) (set! hook/stack-overflow default/stack-overflow) @@ -152,16 +153,29 @@ MIT in each case. |# start-value space-remaining false) +(define gc-boot-loading?) + +(define gc-boot-death-message + "\n;; Aborting boot-load: Not enough memory to load -- Use -large option.\n") + (define (gc-abort-test space-remaining) (if (< space-remaining 4096) - (abort->nearest - (cmdl-message/append - (cmdl-message/strings "Aborting!: out of memory") - ;; Clean up whatever possible to avoid a reoccurrence. - (cmdl-message/active - (lambda (port) - port - (with-gc-notification! true gc-clean))))))) + (if gc-boot-loading? + (let ((console ((ucode-primitive tty-output-channel 0)))) + ((ucode-primitive channel-write 4) + console + gc-boot-death-message + 0 + ((ucode-primitive string-length 1) gc-boot-death-message)) + ((ucode-primitive exit-with-value 1) #x14)) + (abort->nearest + (cmdl-message/append + (cmdl-message/strings "Aborting!: out of memory") + ;; Clean up whatever possible to avoid a reoccurrence. + (cmdl-message/active + (lambda (port) + port + (with-gc-notification! true gc-clean)))))))) ;;;; User Primitives diff --git a/v7/src/runtime/make.scm b/v7/src/runtime/make.scm index f2b40f2de..588035831 100644 --- a/v7/src/runtime/make.scm +++ b/v7/src/runtime/make.scm @@ -1,8 +1,8 @@ #| -*-Scheme-*- -$Header: /Users/cph/tmp/foo/mit-scheme/mit-scheme/v7/src/runtime/make.scm,v 14.31 1991/11/15 05:14:57 cph Exp $ +$Header: /Users/cph/tmp/foo/mit-scheme/mit-scheme/v7/src/runtime/make.scm,v 14.32 1992/02/07 19:47:32 jinx Exp $ -Copyright (c) 1988-91 Massachusetts Institute of Technology +Copyright (c) 1988-1992 Massachusetts Institute of Technology This material was developed by the Scheme project at the Massachusetts Institute of Technology, Department of Electrical Engineering and @@ -383,6 +383,8 @@ MIT in each case. |# (fasload/update-debugging-info! object (car entry)) (load/purification-root object))) fasload-purification-queue))))) + (set! (access gc-boot-loading? (->environment '(RUNTIME GARBAGE-COLLECTOR))) + false) (set! fasload-purification-queue) (newline console-output-port) (write-string "purifying..." console-output-port) diff --git a/v7/src/runtime/version.scm b/v7/src/runtime/version.scm index 965067665..1aa535637 100644 --- a/v7/src/runtime/version.scm +++ b/v7/src/runtime/version.scm @@ -1,8 +1,8 @@ #| -*-Scheme-*- -$Header: /Users/cph/tmp/foo/mit-scheme/mit-scheme/v7/src/runtime/version.scm,v 14.144 1992/01/30 17:08:31 arthur Exp $ +$Header: /Users/cph/tmp/foo/mit-scheme/mit-scheme/v7/src/runtime/version.scm,v 14.145 1992/02/07 19:47:41 jinx Exp $ -Copyright (c) 1988-91 Massachusetts Institute of Technology +Copyright (c) 1988-1992 Massachusetts Institute of Technology This material was developed by the Scheme project at the Massachusetts Institute of Technology, Department of Electrical Engineering and @@ -45,7 +45,7 @@ MIT in each case. |# '())) (add-system! microcode-system) (add-event-receiver! event:after-restore snarf-microcode-version!) - (add-identification! "Runtime" 14 144)) + (add-identification! "Runtime" 14 145)) (define microcode-system) diff --git a/v8/src/runtime/make.scm b/v8/src/runtime/make.scm index 6103ab752..c7f301bdd 100644 --- a/v8/src/runtime/make.scm +++ b/v8/src/runtime/make.scm @@ -1,8 +1,8 @@ #| -*-Scheme-*- -$Header: /Users/cph/tmp/foo/mit-scheme/mit-scheme/v8/src/runtime/make.scm,v 14.31 1991/11/15 05:14:57 cph Exp $ +$Header: /Users/cph/tmp/foo/mit-scheme/mit-scheme/v8/src/runtime/make.scm,v 14.32 1992/02/07 19:47:32 jinx Exp $ -Copyright (c) 1988-91 Massachusetts Institute of Technology +Copyright (c) 1988-1992 Massachusetts Institute of Technology This material was developed by the Scheme project at the Massachusetts Institute of Technology, Department of Electrical Engineering and @@ -383,6 +383,8 @@ MIT in each case. |# (fasload/update-debugging-info! object (car entry)) (load/purification-root object))) fasload-purification-queue))))) + (set! (access gc-boot-loading? (->environment '(RUNTIME GARBAGE-COLLECTOR))) + false) (set! fasload-purification-queue) (newline console-output-port) (write-string "purifying..." console-output-port) -- 2.25.1