changeset 374: |
d1d64b856fae |
parent: |
3c60389fab93
|
child: |
8fe057887c17 |
author: |
Richard Westhaver <ellis@rwest.io> |
date: |
Mon, 27 May 2024 03:08:21 -0400 |
permissions: |
-rw-r--r-- |
description: |
rm dexador dependency |
1 ;;; std/sys.lisp @ 2023-10-14.03:28:40 -*- mode: lisp; -*- 9 ;; (reexport-from :sb-introspect 10 ;; :include '(:function-lambda-list :lambda-list-keywords :lambda-parameters-limit 11 ;; :method-combination-lambda-list :deftype-lambda-list 12 ;; :primitive-object-size :allocation-information 14 ;; :who-specializes-directly :who-specializes-generally 15 ;; :find-function-callees :find-function-callers)) 18 ;; sb-sys:*linkage-info* *machine-version* *runtime-dlhandle* *periodic-polling-function* 19 ;; *periodic-polling-period* io-timeout nlx-protect serve-event os-deinit os-exit with-deadline dlopen-or-lose deallocate-system-memory 21 (defun current-lisp-implementation () 22 "Return the current lisp implemenation as a cons: (TYPE VERSION)" 24 (lisp-implementation-type) 25 (lisp-implementation-version) 29 (defun save-lisp-tree-shake-and-die (path &rest args) 30 "A naive tree-shaker for lisp." 32 (apply #'sb-ext:save-lisp-and-die path args)) 34 (defun save-lisp-and-live (filename completion-function restart &rest args) 35 (flet ((restart-sbcl () 36 (sb-debug::enable-debugger) 37 (setf sb-impl::*descriptor-handlers* nil) 39 ;; fork it - assumes only one thread is running 40 (multiple-value-bind (pipe-in pipe-out) (sb-posix:pipe) 41 (let ((pid (sb-posix:fork))) 42 (cond ((= pid 0) ;; make simple-restart core 43 (sb-posix:close pipe-in) 44 (sb-debug::disable-debugger) 45 (apply #'sb-ext:save-lisp-and-die filename 47 (list :toplevel #'restart-sbcl) 50 (sb-posix:close pipe-out) 51 (sb-sys:add-fd-handler 54 (sb-sys:invalidate-descriptor fd) 56 (multiple-value-bind (rpid status) (sb-posix:waitpid pid 0) ;; wait for master 58 (assert (sb-posix:wifexited status)) 59 (funcall completion-function 60 (zerop (sb-posix:wexitstatus status)))))))))))) 63 ;; (defun decode-all-debug-data () 64 ;; (dolist (code (sb-vm:list-allocated-objects :all :type sb-vm:code-header-widetag)) 65 ;; (let ((info (sb-kernel:%code-debug-info code))) 66 ;; (when (typep info 'sb-c::compiled-debug-info) 67 ;; (let ((fun-map (sb-di::get-debug-info-fun-map 68 ;; (sb-kernel:%code-debug-info code)))) 69 ;; (loop for i from 0 below (length fun-map) by 2 do 70 ;; (let ((cdf (aref fun-map i))) 71 ;; (sb-di::debug-fun-lambda-list 72 ;; (sb-di::make-compiled-debug-fun cdf code)))))) 75 (defun forget-shared-objects () 76 "Set the DONT-SAVE slot of all objects in SB-SYS:*SHARED-OBJECTS* to T." 77 (mapcar (lambda (obj) (setf (sb-alien::shared-object-dont-save obj) t)) sb-sys:*shared-objects*))