0.6.8.13:
[sbcl.git] / src / code / save.lisp
index b61733d..7f0abb0 100644 (file)
@@ -14,9 +14,6 @@
 ;;;; files for more information.
 
 (in-package "SB!IMPL")
-
-(file-comment
-  "$Header$")
 \f
 (defvar *before-save-initializations* nil
   #!+sb-doc
@@ -42,7 +39,7 @@
 ;;; image to make a running Lisp, the memory never gets reclaimed.
 ;;; (But with the PURIFY option it seems to work OK.)
 (defun save-lisp-and-die (core-file-name &key
-                                        (toplevel #'toplevel)
+                                        (toplevel #'toplevel-init)
                                         (purify nil)
                                         (root-structures ())
                                         (environment-name "auxiliary"))
   (dolist (f *before-save-initializations*)
     (funcall f))
   (flet ((restart-lisp ()
-          (sb!unix:unix-exit
-           (catch '%end-of-the-world
-             (reinit)
-             ;; FIXME: Wouldn't it be more correct to do this running
-             ;; backwards through the list, instead of forwards?
-             (dolist (f *after-save-initializations*)
-               (funcall f))
-             (funcall toplevel)))))
+           (handling-end-of-the-world
+            (reinit)
+            (dolist (f *after-save-initializations*)
+              (funcall f))
+            (funcall toplevel))))
     ;; FIXME: Perhaps WITHOUT-GCING should be wrapped around the
     ;; LET as well, to avoid the off chance of an interrupt triggering
     ;; GC and making our saved RESTART-LISP address invalid?