Avoid use of private typedefs
[sbcl.git] / src / code / purify.lisp
blob84a919f54e79bf75d9daa90960db73fd8472b0ef
1 ;;;; This software is part of the SBCL system. See the README file for
2 ;;;; more information.
3 ;;;;
4 ;;;; This software is derived from the CMU CL system, which was
5 ;;;; written at Carnegie Mellon University and released into the
6 ;;;; public domain. The software is in the public domain and is
7 ;;;; provided with absolutely no warranty. See the COPYING and CREDITS
8 ;;;; files for more information.
10 (in-package "SB!KERNEL")
12 (define-alien-routine ("purify" %purify) void
13 (static-roots unsigned-long)
14 (read-only-roots unsigned-long))
16 (defun purify (&key root-structures environment-name)
17 "This function optimizes garbage collection by moving all currently live
18 objects into non-collected storage. ROOT-STRUCTURES is an optional list of
19 objects which should be copied first to maximize locality.
21 DEFSTRUCT structures defined with the (:PURE T) option are moved into
22 read-only storage, further reducing GC cost. List and vector slots of pure
23 structures are also moved into read-only storage.
25 ENVIRONMENT-NAME is unused.
27 This function is a no-op on platforms using the generational garbage
28 collector (x86, x86-64, ppc, arm, arm64)."
29 (declare (ignore environment-name))
30 #!+gencgc
31 (declare (ignore root-structures))
32 #!-gencgc
33 (%purify (get-lisp-obj-address root-structures)
34 (get-lisp-obj-address nil)))