1 ;;;; This software is part of the SBCL system. See the README file for
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
)
18 "This function optimizes garbage collection by moving all currently live
19 objects into non-collected storage. ROOT-STRUCTURES is an optional list of
20 objects which should be copied first to maximize locality.
22 DEFSTRUCT structures defined with the (:PURE T) option are moved into
23 read-only storage, further reducing GC cost. List and vector slots of pure
24 structures are also moved into read-only storage.
26 ENVIRONMENT-NAME is unused.
28 This function is a no-op on platforms using the generational garbage
29 collector (x86, x86-64, ppc, arm, arm64)."
30 (declare (ignore environment-name
))
32 (declare (ignore root-structures
))
34 (%purify
(get-lisp-obj-address root-structures
)
35 (get-lisp-obj-address nil
)))